active_interaction 1.1.4 → 1.1.5

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: 4adec3ae22c841db3e4c32b7d0ef7afa6bd13040
4
- data.tar.gz: e918de7c182f59c682eeeffac6b69a0a51c67d9d
3
+ metadata.gz: 97372d5791c4be395f259a22c60747a6dfcfc54d
4
+ data.tar.gz: fa1052eb313ccc7ed6011ae9565475baea6e498c
5
5
  SHA512:
6
- metadata.gz: 3429815711afac51bba093cc4f2000ebdd304dec3d86ae5616cc3868edd7dda24f21206a4c99beb6c69343fc528da7a5539757ade79dd852ba41445ea171fe2d
7
- data.tar.gz: 4b00d5edf02e3f565b5ef1ecbb80d5f60de694c21b1f0dba6f346a544cb536c4f30fef1af180d2eb99310fe0d3c84f6a09e324c9862fd700f80443edfb3cd14a
6
+ metadata.gz: d97ff17b686cf96e42a93c6b6780d99a1a6c9b6e7c8f080ccff7400da960eb6ecc9577836cb36eaf1a80cf9048c840b806ff4b5135838ec2734b5c2c580da3b8
7
+ data.tar.gz: 7fbe1d890c31c34433e33f1cfd8f8ed22efaea8954bda90df2dedb19fb276aa75fa74bd48b45cf174066d0eca0ac443568723b8dbe811a139fccc070fb35cd67
@@ -1,5 +1,9 @@
1
1
  # [Master][]
2
2
 
3
+ # [1.1.5][] (2014-03-31)
4
+
5
+ - The `transform_keys` method broke backwards compatibility because it's not available until Rails 4.0.2.
6
+
3
7
  # [1.1.4][] (2014-03-31)
4
8
 
5
9
  - Fix an issue where non-stripped hash keys would be incorrectly converted to strings.
@@ -174,7 +178,8 @@
174
178
 
175
179
  - Initial release.
176
180
 
177
- [Master]: https://github.com/orgsync/active_interaction/compare/v1.1.4...master
181
+ [Master]: https://github.com/orgsync/active_interaction/compare/v1.1.5...master
182
+ [1.1.5]: https://github.com/orgsync/active_interaction/compare/v1.1.4...v1.1.5
178
183
  [1.1.4]: https://github.com/orgsync/active_interaction/compare/v1.1.3...v1.1.4
179
184
  [1.1.3]: https://github.com/orgsync/active_interaction/compare/v1.1.2...v1.1.3
180
185
  [1.1.2]: https://github.com/orgsync/active_interaction/compare/v1.1.1...v1.1.2
@@ -41,5 +41,5 @@ I18n.load_path << File.expand_path(
41
41
  #
42
42
  # @since 1.0.0
43
43
  #
44
- # @version 1.1.4
44
+ # @version 1.1.5
45
45
  module ActiveInteraction end
@@ -30,7 +30,7 @@ module ActiveInteraction
30
30
  def cast(value)
31
31
  case value
32
32
  when Hash
33
- value = value.transform_keys { |k| k.is_a?(Symbol) ? k.to_s : k }
33
+ value = symbolize_the_string_keys(value)
34
34
 
35
35
  filters.each_with_object(strip? ? {} : value) do |(name, filter), h|
36
36
  name = name.to_s
@@ -67,5 +67,15 @@ module ActiveInteraction
67
67
  def strip?
68
68
  options.fetch(:strip, true)
69
69
  end
70
+
71
+ # Switch to `transform_keys` once we support only Rails 4.0.2+
72
+ def symbolize_the_string_keys(hash)
73
+ new_hash = {}
74
+ hash.each_key do |key|
75
+ new_key = key.is_a?(Symbol) ? key.to_s : key
76
+ new_hash[new_key] = hash[key]
77
+ end
78
+ new_hash
79
+ end
70
80
  end
71
81
  end
@@ -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.4')
8
+ VERSION = Gem::Version.new('1.1.5')
9
9
  end
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.4
4
+ version: 1.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Aaron Lasseigne