motor-admin 0.2.5 → 0.2.6

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
  SHA256:
3
- metadata.gz: 854fa2c5799dc38f7a9e349de3f6391894a6fc2deaddadb27626f86bc8d6517d
4
- data.tar.gz: e452093f3e2f5157b3561e859f04876b84deae6097c1444f3cbc1562486e3753
3
+ metadata.gz: 9b0f19398ae8e7e11b2d3599dc83707c69acce2ef4731b73a1b7a0c9e006c069
4
+ data.tar.gz: 6c67d6492965989428dfab23a4b5315790ffb1408f572f2e9c38437385e53f60
5
5
  SHA512:
6
- metadata.gz: 368cf58ba672c132ada6dc2803683e59c472029385fe211e7ddda5f302c3c73b529906586fc70cfd957e2fc740a85d81b84752ffc47800fa2a7226310ac879ed
7
- data.tar.gz: a8786928fd85bc54108889ff61a48fce1188d0e3f3f07e9e786197a9ec895a0b58d4db4f93a38513885ff9357f84a4ac521691bfa56f401e2c9bc510976f396c
6
+ metadata.gz: e38ab5f4be4a8d340f2b2568b1cdfa586243ed895f6abdb39dc3509b14bb8d3556d6b0de22671d87ed3a6f11895eb29add8f10e542038b68975a2b89df6334cb
7
+ data.tar.gz: a5800734dc28bd4f1e8e0e559bb5a948756f9270cfd1dc873e8a943021a498dd66dd354361abec776113564e5cc97f7afc9f1447c8e78c17c88da792eb165cf0
@@ -4,6 +4,8 @@ module Motor
4
4
  module CancanUtils
5
5
  module AbilityPatch
6
6
  def serialized_rules
7
+ return [] unless @rules
8
+
7
9
  @rules.map do |rule|
8
10
  {
9
11
  base_behavior: rule.base_behavior,
@@ -13,7 +13,7 @@ module Motor
13
13
  module_function
14
14
 
15
15
  def call(current_user = nil, current_ability = nil, cache_keys: LoadFromCache.load_cache_keys)
16
- CACHE_STORE.fetch("#{I18n.locale}#{cache_keys.hash}#{current_user&.id}") do
16
+ CACHE_STORE.fetch("#{I18n.locale}#{cache_keys.hash}#{current_user&.id}#{current_ability&.rules_hash}") do
17
17
  CACHE_STORE.clear
18
18
 
19
19
  data = build_data(cache_keys, current_user, current_ability)
@@ -14,7 +14,7 @@ module Motor
14
14
 
15
15
  maybe_fetch_from_cache(
16
16
  model,
17
- cache_key,
17
+ cache_key.to_s + model.object_id.to_s,
18
18
  lambda {
19
19
  resource_config = configs.find { |r| r.name == model.name.underscore }
20
20
 
data/lib/motor/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Motor
4
- VERSION = '0.2.5'
4
+ VERSION = '0.2.6'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: motor-admin
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.5
4
+ version: 0.2.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pete Matsyburka
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-10-10 00:00:00.000000000 Z
11
+ date: 2021-10-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord-filter