apicasso 0.7.1 → 0.7.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/controllers/apicasso/crud_controller.rb +12 -3
- data/lib/apicasso/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 34fb159f9a8848d86bdefa10d316ef4e327620f7c5a6e645a0585608853ad8ef
|
4
|
+
data.tar.gz: 67c3675ddb57dcdd6ef6e5aaa5bc8078425b0921bd24e118b123288926bbaf7d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: da0659b481e87a0192ff45872b8c407eddcf7321c174aad5bca955c68aaeb6b5d21e50db7321a20137e70dd5492430466726b1c72b02552fed14b254fbb6b798
|
7
|
+
data.tar.gz: e919eb141396a0acbf908f3d067d516af8818a0abe814c48d1015d837f2083d5972256c76c74020670371d1f078abd916c83639d8524cf2b92a59f40903c2a41
|
@@ -97,8 +97,8 @@ module Apicasso
|
|
97
97
|
# going to be rendered, if authorized
|
98
98
|
def set_records
|
99
99
|
authorize! :read, resource.name.underscore.to_sym
|
100
|
-
@records =
|
101
|
-
@object =
|
100
|
+
@records = request_collection.ransack(parsed_query).result
|
101
|
+
@object = request_collection.new
|
102
102
|
key_scope_records
|
103
103
|
reorder_records if params[:sort].present?
|
104
104
|
select_fields if params[:select].present?
|
@@ -182,7 +182,16 @@ module Apicasso
|
|
182
182
|
|
183
183
|
# Setup to stablish the nested model to be queried
|
184
184
|
def set_nested_resource
|
185
|
-
@nested_resource =
|
185
|
+
@nested_resource = request_collection.klass
|
186
|
+
end
|
187
|
+
|
188
|
+
# Gets the collection of objects based on request
|
189
|
+
def request_collection
|
190
|
+
if params[:nested].present?
|
191
|
+
@object.send(params[:nested].underscore.pluralize)
|
192
|
+
else
|
193
|
+
resource
|
194
|
+
end
|
186
195
|
end
|
187
196
|
end
|
188
197
|
end
|
data/lib/apicasso/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: apicasso
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.7.
|
4
|
+
version: 0.7.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Fernando Bellincanta
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-04-
|
11
|
+
date: 2019-04-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|