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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ab915220af5d95373eaa8b8a57563d311a7f2903
4
- data.tar.gz: ea007c8d5b61f511dcbfd799432d5221dd666804
3
+ metadata.gz: 61ae8325860ffdbf44f5b3b5a90e8b3e3647ff7d
4
+ data.tar.gz: ae22ead6bad6f7d046261431634cf6a7208ab9c0
5
5
  SHA512:
6
- metadata.gz: dd645226ade084917ddc64405009d1c7c6f2b8ead5c69544be10e296264a963ab38ab2f851ac46633cbb36c45d052330a1899e3381b1517bc1804c83fb7dbf26
7
- data.tar.gz: 0e7ecdb8a56621234a9f52dc9c3f8a6131b55ea0674fe7c78a5c1f84c66305f0ce80a7137d2d3e0a109cae2260cd9cf4f23e8de257906be08aa9f9f843180462
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
@@ -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)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module IAmICan
4
- VERSION = '4.4.0'
4
+ VERSION = '4.4.1'
5
5
  end
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.0
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-02-18 00:00:00.000000000 Z
11
+ date: 2019-04-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler