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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9f9c60dd321058f51a039fcefa9c3540a91a8479
4
- data.tar.gz: 76fa93ef759bfd5921d838ef921231ebec673788
3
+ metadata.gz: 113e01e0daf944524f10664bf402096ad916a57e
4
+ data.tar.gz: 3c23744ac2b168352c8ba13739d762511f1a4d37
5
5
  SHA512:
6
- metadata.gz: 764e3d241e12c19c20ac484a5e33ccb03559010337da5f09eb3d1d8a8f3641a40e9d245ad36680975fafd712ef49b563a9185e65d2342c09fc4e788273dde7dc
7
- data.tar.gz: 6e3869323449bd68052dff3854a45bd92b618f9153d4894e50d7c4fac965ad836d68ec0eab7828db897611154f0e7fcef7d186cf256272dd11d1eea1a0d3f98b
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
 
@@ -1,3 +1,3 @@
1
1
  module MongoidAbility
2
- VERSION = "0.1.6"
2
+ VERSION = "0.1.7"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mongoid_ability
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.6
4
+ version: 0.1.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tomas Celizna