i_am_i_can 4.4.0 → 4.4.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/i_am_i_can/role/assignment.rb +2 -2
- data/lib/i_am_i_can/subject.rb +1 -1
- data/lib/i_am_i_can/version.rb +1 -1
- 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: 61ae8325860ffdbf44f5b3b5a90e8b3e3647ff7d
|
4
|
+
data.tar.gz: ae22ead6bad6f7d046261431634cf6a7208ab9c0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ed6cfd6f6bd032d67ca894c1e0b5337cd98e35ea43c76554953593a4202af33afe760cd6f93e192a75b6481f5302c1a49ebaad9edf8a9b2e8da900329b13317f
|
7
|
+
data.tar.gz: a8f16329d8abc596f58777ff27cd2d702e91ebba382c842675a559584777a6775d8c197a8cb3b95a7a1c73385664972e1fe98e17e8c487211dd7d5b7384f8410
|
@@ -7,7 +7,7 @@ module IAmICan
|
|
7
7
|
_d: i_am_i_can.auto_definition, auto_definition: _d || which_can.present?,
|
8
8
|
expires_in: nil, expires_at: (expires_in.after if expires_in), save: true
|
9
9
|
self.class.have_roles *roles, which_can: which_can, obj: obj if auto_definition
|
10
|
-
run_callbacks(:role_assign) do
|
10
|
+
run_callbacks(save ? :role_assign : :role_none) do
|
11
11
|
_roles_assignment(roles, save, exp: expires_at)
|
12
12
|
end
|
13
13
|
end
|
@@ -17,7 +17,7 @@ module IAmICan
|
|
17
17
|
end
|
18
18
|
|
19
19
|
def falls_from *roles, saved: true
|
20
|
-
run_callbacks(:cancel_role_assign) do
|
20
|
+
run_callbacks(saved ? :cancel_role_assign : :role_none) do
|
21
21
|
_roles_assignment(:cancel, roles, saved)
|
22
22
|
end
|
23
23
|
end
|
data/lib/i_am_i_can/subject.rb
CHANGED
@@ -11,7 +11,7 @@ module IAmICan
|
|
11
11
|
end
|
12
12
|
|
13
13
|
included do
|
14
|
-
define_model_callbacks :role_assign, :cancel_role_assign, :role_update
|
14
|
+
define_model_callbacks :role_assign, :cancel_role_assign, :role_update, :role_none
|
15
15
|
|
16
16
|
Object.const_set (role_assoc_class = reflections[__roles].options[:join_table].camelize),
|
17
17
|
Class.new(ActiveRecord::Base)
|
data/lib/i_am_i_can/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: i_am_i_can
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.4.
|
4
|
+
version: 4.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- zhandao
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-04-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|