mongoid_ability 0.0.4 → 0.0.5
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/mongoid_ability/owner.rb +1 -1
- data/lib/mongoid_ability/subject.rb +2 -2
- data/lib/mongoid_ability/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: a9a82de3d605e183be4312f39a57f7bbd9766166
|
|
4
|
+
data.tar.gz: 533cc7a7f76e8aa3b0867e60f9363253397a5202
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 02231a5fd23515b5842104d16a0a9b8a83548c6ab47e68d7c150fc2a13373e6898125be0c8381c2e4740ea1ab71ccd991539706273298ebe37f8986b351e87e3
|
|
7
|
+
data.tar.gz: 4f3c0714a5dfe7f17b9adeddb0e42f79086f50e8af1ebbdb86b4a750be0be607988c7f03a89df88a72ba2548b3b5205096339d2707676a663e2e17889958de22
|
|
@@ -27,7 +27,7 @@ module MongoidAbility
|
|
|
27
27
|
# override if needed
|
|
28
28
|
# return for example 'MyLock'
|
|
29
29
|
def lock_class_name
|
|
30
|
-
@lock_class_name ||= Object.
|
|
30
|
+
@lock_class_name ||= Object.descendants.detect{ |cls| cls < MongoidAbility::Lock }.name
|
|
31
31
|
end
|
|
32
32
|
end
|
|
33
33
|
|
|
@@ -27,7 +27,7 @@ module MongoidAbility
|
|
|
27
27
|
# override if needed
|
|
28
28
|
# return for example 'MyLock'
|
|
29
29
|
def lock_class_name
|
|
30
|
-
Object.
|
|
30
|
+
Object.descendants.detect{ |cls| cls < MongoidAbility::Lock }.name
|
|
31
31
|
end
|
|
32
32
|
|
|
33
33
|
# ---------------------------------------------------------------------
|
|
@@ -49,7 +49,7 @@ module MongoidAbility
|
|
|
49
49
|
return cr unless ability.user.present?
|
|
50
50
|
|
|
51
51
|
supercls = self.ancestors_with_default_locks.last || self
|
|
52
|
-
subject_classes = [supercls].concat(supercls.
|
|
52
|
+
subject_classes = [supercls].concat(supercls.descendants)
|
|
53
53
|
|
|
54
54
|
subject_classes.each do |cls|
|
|
55
55
|
|