dry-ability 0.0.1 → 0.0.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: 8d5704a2a2bf2199fda53a0a74556d9f93c1cc82a46ef9d9912d2452f34fce4f
4
- data.tar.gz: b9dd8b4243ad05c462fd14a2052c623bac572588941368f3943a91d6228ce548
3
+ metadata.gz: b51d09b93913b6fcdf0ecd27d8872058d31e127d4e96b2039dc06a7301ea4241
4
+ data.tar.gz: '08cc32166ee95968493474d8e20a1330723862171abfcb1711ee096b8cbac078'
5
5
  SHA512:
6
- metadata.gz: 816667eb2d315a2fda11b40df7e1a5bef065f4425cb4a6785e9bcf617c4761670b9b406f3ddfacef5d0ccde498ef9d226c2f6a4a66596ee8dee0b0c1f04a4944
7
- data.tar.gz: de539543156d5b2b9878a0057f4e5271100c06d7d74d9fce7e5abe56215d85a6d7a68db281f258838eff31e6bf044d0b125b52de6b766a9d0392f6f6115a3cb6
6
+ metadata.gz: 3c51abe75631360a9a7082511fc32cab03e5fea5ee50d8161c5dd9ab1671723bd988f34f878573b0848a82e5973756e2b2afa77453e5983eaa0a7613937d43bb
7
+ data.tar.gz: e8b9a26a91973ab49b64424662566a43485e2355bc482a8e27f25ebf0238d906411e13cd72d56b901c71e962fc7e7d365e866f178155026baaede6bf7fd13d24
@@ -97,8 +97,8 @@ module Dry
97
97
  end
98
98
 
99
99
  def initial_attributes
100
- current_ability.attributes_for(@action_name, resource_class).delete_if do |key, _|
101
- resource_params && resource_params.include?(key)
100
+ current_ability.attributes_for(@action_name, resource_class).delete_if do |key, value|
101
+ (resource_params && resource_params.include?(key)) || value.is_a?(Hash)
102
102
  end
103
103
  end
104
104
 
@@ -14,7 +14,7 @@ module Dry
14
14
 
15
15
  def initialize(message = nil, subject:, action:, candidates: NONE)
16
16
  @action, @subject = action, subject
17
- message ||= format(DEFAULT_MESSAGE_TEMPLATE, subject, action, candidates)
17
+ message ||= format(DEFAULT_MESSAGE_TEMPLATE, subject.class, action, candidates)
18
18
  super(message)
19
19
  end
20
20
  end
@@ -28,7 +28,7 @@ module Dry
28
28
 
29
29
  def initialize(message = nil, action, subject)
30
30
  @action, @subject = action, subject
31
- message ||= format(DEFAULT_MESSAGE_TEMPLATE, action, subject)
31
+ message ||= format(DEFAULT_MESSAGE_TEMPLATE, action, subject.class)
32
32
  super(message)
33
33
  end
34
34
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Dry
4
4
  module Ability
5
- VERSION = '0.0.1'
5
+ VERSION = '0.0.3'
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dry-ability
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Anton Semenov
@@ -9,10 +9,10 @@ authors:
9
9
  - Bryan Rite
10
10
  - Ryan Bates
11
11
  - Richard Wilson
12
- autorequire:
12
+ autorequire:
13
13
  bindir: bin
14
14
  cert_chain: []
15
- date: 2021-08-06 00:00:00.000000000 Z
15
+ date: 2023-10-29 00:00:00.000000000 Z
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency
18
18
  name: activesupport
@@ -192,7 +192,7 @@ homepage: https://github.com/estum/dry-ability
192
192
  licenses:
193
193
  - MIT
194
194
  metadata: {}
195
- post_install_message:
195
+ post_install_message:
196
196
  rdoc_options: []
197
197
  require_paths:
198
198
  - lib
@@ -208,7 +208,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
208
208
  version: '0'
209
209
  requirements: []
210
210
  rubygems_version: 3.0.3
211
- signing_key:
211
+ signing_key:
212
212
  specification_version: 4
213
213
  summary: Dried authorization solution for Rails.
214
214
  test_files: []