action_policy 0.4.1 → 0.4.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: da3eeea696df1575a8760726735ecc8a904e1740424dbf0c808689f0411be7a6
4
- data.tar.gz: 9bbe91fcf1c0ce50ae029ceeca533c93a7d686777b7d2dc64556790e0adde9b3
3
+ metadata.gz: 946e026afb064f557ce87761fb4ddb981635d0b95ca5f8a6415ae7572932f758
4
+ data.tar.gz: c97a78ac4be2b1482280c70345caa881d4b6d126e1d92c7b8e852592ccca09ed
5
5
  SHA512:
6
- metadata.gz: 3b7899a9c61c1c61178b3d2cb5c5bd57f526518ffab96211e747edcba7e8f88a1c8d35452416551331d7e78cca87639bd90f34508f3ebb6edda66a8efe0fab42
7
- data.tar.gz: 95029c9883cbe100b9fdc0368446184f9487075923e8151eba0ba02dd5c9da6cc11b31e96b2053ff2f034fcaed200bfc157c6b7eab1c60e38553403113205b6f
6
+ metadata.gz: 5585386d303ef8af41651a3951fadd6970d4a127226a88b7c220852235d8f7cd34f7b608ef1390ed02b921fe64f93abc9d0ddc2d2f0780293e7b925818830d17
7
+ data.tar.gz: '0954283e4e9576ced888c80e1e02bec3fa2c128f69f79962ba748b69aa6fbab0c46814746a9ac6fe36dd2609dc9a626fb4ee51848b84a5ebe3a584838e2eeb9e'
@@ -2,7 +2,7 @@
2
2
 
3
3
  ## master
4
4
 
5
- ## 0.4.1 (2019-12-13)
5
+ ## 0.4.2 (2019-12-13)
6
6
 
7
7
  - Fix regression introduced in 0.4.0 which broke testing Class targets. ([@palkan][])
8
8
 
@@ -3,17 +3,6 @@
3
3
  module ActionPolicy
4
4
  # Testing utils
5
5
  module Testing
6
- # Hack to match both classes and composed matchers:
7
- # be_authorized_to(:create?, User)
8
- # be_authorized_to(:maanage?, an_instance_of(User))
9
- using(Module.new do
10
- refine Module do
11
- def ===(other)
12
- self == other
13
- end
14
- end
15
- end)
16
-
17
6
  # Collects all Authorizer calls
18
7
  module AuthorizeTracker
19
8
  class Call # :nodoc:
@@ -26,7 +15,7 @@ module ActionPolicy
26
15
 
27
16
  def matches?(policy_class, actual_rule, target)
28
17
  policy_class == policy.class &&
29
- target === policy.record &&
18
+ (target.is_a?(Class) ? target == policy.record : target === policy.record) &&
30
19
  rule == actual_rule
31
20
  end
32
21
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ActionPolicy
4
- VERSION = "0.4.1"
4
+ VERSION = "0.4.2"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: action_policy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.1
4
+ version: 0.4.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vladimir Dementyev