yodatra 0.3.7 → 0.3.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/yodatra/models_controller.rb +3 -2
- data/lib/yodatra/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: a52754b7a6169ae899266b3e18672c7b2d1ec89d
|
|
4
|
+
data.tar.gz: 94e4985f0cbd1e7651a199b545a6bd4bc70da36b
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: d5860fe9fd842c6503b3a664894ab94fd890faca960a32d9099d343c0673a99305e2a7a4af28ff601e9dd045afb35ecba5275de14d672aa72a6e9bd18a128b47
|
|
7
|
+
data.tar.gz: 5d7bef223457d35c365452e634457465c3a7d330a75a86aec2bb043d7d0bba74cf9569ae7f8deada69848444209f4446508d758063f830dc0827f6a415426f78
|
|
@@ -183,8 +183,8 @@ module Yodatra
|
|
|
183
183
|
resource = nested? ? nested : model
|
|
184
184
|
|
|
185
185
|
# Check access to the resource
|
|
186
|
-
method = "
|
|
187
|
-
resource = send(method, resource) if respond_to?
|
|
186
|
+
method = "limit_#{action}_for".to_sym
|
|
187
|
+
resource = model.send(method, resource, current_user) if respond_to?(method) && !current_user.nil?
|
|
188
188
|
|
|
189
189
|
# ONE resource else COLLECTION
|
|
190
190
|
one_id = nested? ? params[:captures].fourth : params[:captures].second if params[:captures].length == 4
|
|
@@ -208,6 +208,7 @@ module Yodatra
|
|
|
208
208
|
end
|
|
209
209
|
|
|
210
210
|
unless parent_model.nil?
|
|
211
|
+
parent_model = parent_model.limit_read_for parent_model, current_user if parent_model.respond_to?(:limit_read_for) && !current_user.nil?
|
|
211
212
|
parent = parent_model.find params[:captures].second
|
|
212
213
|
if parent.respond_to? :reflections
|
|
213
214
|
# This is AR 4.0.x compatibility
|
data/lib/yodatra/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: yodatra
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.3.
|
|
4
|
+
version: 0.3.8
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Paul Bonaud
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2014-
|
|
11
|
+
date: 2014-10-01 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rack
|