action_policy 0.5.2 → 0.5.3

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: 7922156f6a9b0fa40a6451b6f6c114a0ea8d7f52d9d050ecfd266a5575357c6e
4
- data.tar.gz: d38c700872a91ddad81a4d2db99cb4415d4ccf51064ec10db10771ebcf517c5f
3
+ metadata.gz: 5e0d9085b8204e1846c9820dbc5eb7a9960fa9c512a51d942cc8aab16b065257
4
+ data.tar.gz: c85bf2348affc45eb365200070257bc31b873ded038033a0fb3d6f5ca8adb48d
5
5
  SHA512:
6
- metadata.gz: efcd8c5cd621c6b08c713e71e37416e1b88a400e1f4195039059bb6d1d8baf7d09edb9425ebc0d2bdbc3a64ae6c94f78c39b55017bd918bedf890a6a107ad5b6
7
- data.tar.gz: ca147c91c0da934f98787a4ec8ed0a84173363c828729d4d8cddb0df11a0ec4895efb63d7d25b3b9a969e807d338063ddf4746e9b4156211d96e5d8ff696a272
6
+ metadata.gz: 2a1de70b5460eed8dc481a651ea52318e060fb486e604b0595f0fa09a4840a0eb93be2b90b7f20789cb135e62388f00a18650881e9739564ba311d11a3fbd131
7
+ data.tar.gz: 5cbcf29add9f224ce3b77a42a17ab403dec7f2f93a581f6ad25e13d8f1e75bc650d9889cb05dd247355fee6b6844fb400852f51b2d1118ac30076e5277b95e75
@@ -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.2"
4
+ VERSION = "0.5.3"
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.2
4
+ version: 0.5.3
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-10-01 00:00:00.000000000 Z
11
+ date: 2020-10-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: ruby-next
14
+ name: ruby-next-core
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
17
  - - ">="