sevn 0.0.5 → 0.0.6
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/CHANGELOG +2 -0
- data/lib/sevn/ability.rb +1 -10
- data/lib/sevn/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 03d77ac9ed3fb8b4b194d897a47b5ee649c1f9a4
|
4
|
+
data.tar.gz: 4ecfacf816994d0b87be0fc6773b981e9619f022
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 25d45e748be5b1d6a21ce467c42282a4b0d048524e5046272a32560ddfa5a4d5323f3f9869957c119505923827ffcb1d3c712f3bcd0b52100e0e0b915e0ef3e2
|
7
|
+
data.tar.gz: 31d5bab187102693868e8964b6ae759fd206354ea56a976ae54cac708b49300e00787748c4b6d67fa0e6dc718f6077d4fc5df3e3d48d1ca5656d30b79303b47f
|
data/CHANGELOG
CHANGED
data/lib/sevn/ability.rb
CHANGED
@@ -105,11 +105,7 @@ module Sevn
|
|
105
105
|
end
|
106
106
|
|
107
107
|
def action_allowed?(object, action, subjects, options)
|
108
|
-
if
|
109
|
-
subjects = subjects.to_a
|
110
|
-
end
|
111
|
-
|
112
|
-
if subjects.kind_of?(Array)
|
108
|
+
if subjects.respond_to?(:each)
|
113
109
|
# if subjects is an Array, let's group them by class
|
114
110
|
# check if action is allowed for the whole class or to all the subjects of that class
|
115
111
|
subjects.group_by(&:class).all? do |class_name, subjects_of_class|
|
@@ -168,10 +164,5 @@ module Sevn
|
|
168
164
|
tr("-", "_").
|
169
165
|
downcase
|
170
166
|
end
|
171
|
-
|
172
|
-
def collection_proxy_defined?
|
173
|
-
defined?(ActiveRecord::Associations::CollectionProxy) == 'constant' &&
|
174
|
-
ActiveRecord::Associations::CollectionProxy.class == Class
|
175
|
-
end
|
176
167
|
end
|
177
168
|
end
|
data/lib/sevn/version.rb
CHANGED