mongoid_ability 0.2.0 → 0.2.1
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/subject.rb +5 -5
- data/lib/mongoid_ability/version.rb +1 -1
- data/test/mongoid_ability/subject_test.rb +10 -10
- data/test/test_helper.rb +3 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2419970ae62d412e5779447e3b68ad88999e65fc
|
4
|
+
data.tar.gz: 2850d0cc5ce00717c5aa9ee21af855a50f01edbe
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 55f72d123b8ba7dc2dd788c2403a1616b8b73516cc96a36d4a7600294675d548390dec31fdb1274cf334306aba42e1ddc419d67b551eb26c5ff43cf48e81f239
|
7
|
+
data.tar.gz: b16ce12d9d7ed6a604c3b2b4774018f9de5e1e193b5ccc7c0cf4bcc0fa9f00ca896cd59e32cff37020d6ebe803140742b6caef3d82c17f22cee986e9e3c25d4b
|
@@ -17,11 +17,11 @@ module MongoidAbility
|
|
17
17
|
end
|
18
18
|
|
19
19
|
def default_lock lock_cls, action, outcome, options={}
|
20
|
-
unless is_root_class?
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
end
|
20
|
+
# unless is_root_class?
|
21
|
+
# unless root_class.has_default_lock_for_action?(action)
|
22
|
+
# raise StandardError, "action is not defined on root class (#{root_class})"
|
23
|
+
# end
|
24
|
+
# end
|
25
25
|
|
26
26
|
lock = lock_cls.new( subject_type: self.to_s, action: action, outcome: outcome, options: options )
|
27
27
|
|
@@ -20,16 +20,16 @@ module MongoidAbility
|
|
20
20
|
end
|
21
21
|
end
|
22
22
|
|
23
|
-
describe 'when lock not defined on superclass' do
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
end
|
23
|
+
# describe 'when lock not defined on superclass' do
|
24
|
+
# before do
|
25
|
+
# MySubject.default_locks = []
|
26
|
+
# MySubject1.default_locks = []
|
27
|
+
# end
|
28
|
+
#
|
29
|
+
# it 'must raise error' do
|
30
|
+
# -> { MySubject1.default_lock MyLock, :test, true }.must_raise StandardError
|
31
|
+
# end
|
32
|
+
# end
|
33
33
|
|
34
34
|
describe 'prevents conflicts' do
|
35
35
|
before do
|
data/test/test_helper.rb
CHANGED
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.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tomáš Celizna
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-10
|
11
|
+
date: 2015-12-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: cancancan
|