action_policy 0.5.1 → 0.5.2

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: 90b8e4f19873080b0353ab3b1df8b23bc468b2702e2f9798caf45c1a53bff82e
4
- data.tar.gz: 802d9b6589a5e1c4686718e993cf0389a5bcb1d270a751516245e8dd7f175a78
3
+ metadata.gz: 7922156f6a9b0fa40a6451b6f6c114a0ea8d7f52d9d050ecfd266a5575357c6e
4
+ data.tar.gz: d38c700872a91ddad81a4d2db99cb4415d4ccf51064ec10db10771ebcf517c5f
5
5
  SHA512:
6
- metadata.gz: 63c57ef86e1d488f7816860728452a409ec7225db6666c1b59913ddfedacda5030d55c95a0c94435049cf63425c0ddb01a3010a4ba494fe05fbcc503b938acb0
7
- data.tar.gz: 714a3089ff46e2df58fcc1c9f37f74ead81a8db9dd063a19eab9e6193ed3c50ddc075ae44a6e375dad4de4581f0889609b21b3600fb7ecb1539c12ff7fec7f3a
6
+ metadata.gz: efcd8c5cd621c6b08c713e71e37416e1b88a400e1f4195039059bb6d1d8baf7d09edb9425ebc0d2bdbc3a64ae6c94f78c39b55017bd918bedf890a6a107ad5b6
7
+ data.tar.gz: ca147c91c0da934f98787a4ec8ed0a84173363c828729d4d8cddb0df11a0ec4895efb63d7d25b3b9a969e807d338063ddf4746e9b4156211d96e5d8ff696a272
@@ -185,10 +185,12 @@ module ActionPolicy
185
185
  def allowed_to?(rule, record = :__undef__, **options)
186
186
  res =
187
187
  if (record == :__undef__ || record == self.record) && options.empty?
188
+ rule = resolve_rule(rule)
188
189
  policy = self
189
190
  with_clean_result { apply(rule) }
190
191
  else
191
192
  policy = policy_for(record: record, **options)
193
+ rule = policy.resolve_rule(rule)
192
194
 
193
195
  policy.apply(rule)
194
196
  policy.result
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ActionPolicy
4
- VERSION = "0.5.1"
4
+ VERSION = "0.5.2"
5
5
  end
metadata CHANGED
@@ -1,17 +1,17 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: action_policy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.1
4
+ version: 0.5.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vladimir Dementyev
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-09-30 00:00:00.000000000 Z
11
+ date: 2020-10-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: ruby-next-core
14
+ name: ruby-next
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
17
  - - ">="