active_interaction 1.1.3 → 1.1.4

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
  SHA1:
3
- metadata.gz: a9a8019b903bfbeba2211de79394b8b0dbfb4cb7
4
- data.tar.gz: 296e024fabb906a8e7c384ce24a4cbfbee9399c1
3
+ metadata.gz: 4adec3ae22c841db3e4c32b7d0ef7afa6bd13040
4
+ data.tar.gz: e918de7c182f59c682eeeffac6b69a0a51c67d9d
5
5
  SHA512:
6
- metadata.gz: c75830ad9762f759a717a663bfc3e2e1a0f55dcdfcc07499aef6ac3aca60678f309b05a46d69323c338dd4e3fd7f5f6f123bcc486a22c9373dcef2392638d540
7
- data.tar.gz: 219168712b0e6eb4dcbe9d040b0fcc2efd29349265c0d5b6c243896eb9bd5d3e81df816884fbbe36efc9348e5a7bd1c00cc0031b1f029243225ce9366a6f677f
6
+ metadata.gz: 3429815711afac51bba093cc4f2000ebdd304dec3d86ae5616cc3868edd7dda24f21206a4c99beb6c69343fc528da7a5539757ade79dd852ba41445ea171fe2d
7
+ data.tar.gz: 4b00d5edf02e3f565b5ef1ecbb80d5f60de694c21b1f0dba6f346a544cb536c4f30fef1af180d2eb99310fe0d3c84f6a09e324c9862fd700f80443edfb3cd14a
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # [Master][]
2
2
 
3
+ # [1.1.4][] (2014-03-31)
4
+
5
+ - Fix an issue where non-stripped hash keys would be incorrectly converted to strings.
6
+
3
7
  # [1.1.3][] (2014-03-31)
4
8
 
5
9
  - Fix Rubocop errors and pin the version to avoid future issues with new cops
@@ -170,7 +174,8 @@
170
174
 
171
175
  - Initial release.
172
176
 
173
- [Master]: https://github.com/orgsync/active_interaction/compare/v1.1.3...master
177
+ [Master]: https://github.com/orgsync/active_interaction/compare/v1.1.4...master
178
+ [1.1.4]: https://github.com/orgsync/active_interaction/compare/v1.1.3...v1.1.4
174
179
  [1.1.3]: https://github.com/orgsync/active_interaction/compare/v1.1.2...v1.1.3
175
180
  [1.1.2]: https://github.com/orgsync/active_interaction/compare/v1.1.1...v1.1.2
176
181
  [1.1.1]: https://github.com/orgsync/active_interaction/compare/v1.1.0...v1.1.1
@@ -41,5 +41,5 @@ I18n.load_path << File.expand_path(
41
41
  #
42
42
  # @since 1.0.0
43
43
  #
44
- # @version 1.1.3
44
+ # @version 1.1.4
45
45
  module ActiveInteraction end
@@ -30,7 +30,8 @@ module ActiveInteraction
30
30
  def cast(value)
31
31
  case value
32
32
  when Hash
33
- value = value.stringify_keys
33
+ value = value.transform_keys { |k| k.is_a?(Symbol) ? k.to_s : k }
34
+
34
35
  filters.each_with_object(strip? ? {} : value) do |(name, filter), h|
35
36
  name = name.to_s
36
37
  h[name] = filter.clean(value[name])
@@ -5,5 +5,5 @@ module ActiveInteraction
5
5
  # The version number.
6
6
  #
7
7
  # @return [Gem::Version]
8
- VERSION = Gem::Version.new('1.1.3')
8
+ VERSION = Gem::Version.new('1.1.4')
9
9
  end
@@ -52,6 +52,21 @@ describe ActiveInteraction::HashFilter, :filter do
52
52
  end
53
53
  end
54
54
  end
55
+
56
+ context 'keys are symbolized' do
57
+ let(:value) { { 'a' => 'a', 1 => 1 } }
58
+ before do
59
+ options.merge!(strip: false)
60
+ end
61
+
62
+ it 'symbolizes String keys' do
63
+ expect(filter.cast(value)).to have_key :a
64
+ end
65
+
66
+ it 'leaves other keys alone' do
67
+ expect(filter.cast(value)).to have_key 1
68
+ end
69
+ end
55
70
  end
56
71
 
57
72
  describe '#default' do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: active_interaction
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.3
4
+ version: 1.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Aaron Lasseigne