mongoid_ability 0.0.7 → 0.0.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3fbc4ee9c2161070d8e1a2f9d79f53318239fe61
4
- data.tar.gz: 5356a70dcb98c19d3744dea5eea22c28b6d4b2a3
3
+ metadata.gz: 74b05128ad1b7880b1082fbeddf304463a86bb60
4
+ data.tar.gz: a14d2b70096be646ed72fb2f20b87cb4bd351236
5
5
  SHA512:
6
- metadata.gz: c1bab6862b3fb65d502b87982a4181eb6a2054ac78d7dced498732a7aaf194ed843f35ff0df8c13f10580ae1523dfeb760dc4c643c024d8b99b0ccd351f6592f
7
- data.tar.gz: f3fc6a6559d09bc54233b60b5efabfd037ec68a32af7b2416e65bb295d981c6c53715e0a85dd15f0efe78f12bdef9fa659dc937be0423a94f253c30d20737f19
6
+ metadata.gz: 29c3b53f72217a2aa8489a338370da1925c4155b9a4dd4d251eb5f3720da8c7d0535532f0d38e251d6bf24d6f363b2742b8ea1ab59ba131252534cd5f22506af
7
+ data.tar.gz: 29932436d700cb14e9967a0e345b20a2919c93b31bf4747076043508686672ac42b06fa071c23bbee4235e9e938d5e9a78a7cbbbce3ca9904eaf2b0c6285c1c8
@@ -14,6 +14,11 @@ module MongoidAbility
14
14
  @default_locks ||= []
15
15
  end
16
16
 
17
+ def default_locks_with_inherited
18
+ return default_locks unless superclass.respond_to?(:default_locks_with_inherited)
19
+ superclass.default_locks_with_inherited.concat(default_locks)
20
+ end
21
+
17
22
  def default_locks= val
18
23
  @default_locks = val
19
24
  end
@@ -1,3 +1,3 @@
1
1
  module MongoidAbility
2
- VERSION = "0.0.7"
2
+ VERSION = "0.0.8"
3
3
  end
@@ -29,15 +29,21 @@ module MongoidAbility
29
29
  # =====================================================================
30
30
 
31
31
  describe 'class methods' do
32
- it 'has .default_locks' do
32
+ it '.default_locks' do
33
33
  subject.class.must_respond_to :default_locks
34
34
  subject.class.default_locks.must_be_kind_of Array
35
35
  end
36
36
 
37
- it 'has .default_lock' do
37
+ it '.default_lock' do
38
38
  subject.class.must_respond_to :default_lock
39
39
  end
40
40
 
41
+ it 'default_locks_with_inherited' do
42
+ subject.class.must_respond_to :default_locks_with_inherited
43
+ subject.class.default_locks_with_inherited.must_be_kind_of Array
44
+ subject_test_1.class.default_locks_with_inherited.must_equal subject.class.default_locks
45
+ end
46
+
41
47
  describe '.default_lock' do
42
48
  it 'sets up new Lock' do
43
49
  lock = subject.class.default_locks.first
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mongoid_ability
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.7
4
+ version: 0.0.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tomas Celizna
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-06-10 00:00:00.000000000 Z
11
+ date: 2015-06-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: cancancan
@@ -189,7 +189,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
189
189
  version: '0'
190
190
  requirements: []
191
191
  rubyforge_project:
192
- rubygems_version: 2.4.6
192
+ rubygems_version: 2.4.8
193
193
  signing_key:
194
194
  specification_version: 4
195
195
  summary: Custom Ability class that allows CanCanCan authorization library store permissions