mongoid_ability 0.1.6 → 0.1.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/mongoid_ability/ability.rb +10 -0
- 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: 113e01e0daf944524f10664bf402096ad916a57e
|
4
|
+
data.tar.gz: 3c23744ac2b168352c8ba13739d762511f1a4d37
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1bc440f3326d1b305ff277b0c3a7b5dd577ad79c1808dc3c80d23917a534b645249f7e373f0d4a1d56da810300379d6d9d1754d3157a25b8df452fa05cfd740b
|
7
|
+
data.tar.gz: 62a122fad732b65ece84495df5ec7240d6c54912a363ef3d76f4bea1188490e4e8da53eadf4b25a5aab999b2e3472e2ce32e4ec2ffc1a6b20643bc99db07a0b9
|
@@ -6,6 +6,16 @@ module MongoidAbility
|
|
6
6
|
|
7
7
|
attr_reader :owner
|
8
8
|
|
9
|
+
def self.subject_classes
|
10
|
+
Object.descendants.select{ |cls| cls.included_modules.include?(MongoidAbility::Subject) }
|
11
|
+
end
|
12
|
+
|
13
|
+
def self.subject_root_classes
|
14
|
+
subject_classes.reject{ |cls| cls.superclass.included_modules.include?(MongoidAbility::Subject) }
|
15
|
+
end
|
16
|
+
|
17
|
+
# =====================================================================
|
18
|
+
|
9
19
|
def initialize owner
|
10
20
|
@owner = owner
|
11
21
|
|