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 +4 -4
- data/CHANGELOG.md +6 -1
- data/lib/active_interaction.rb +1 -1
- data/lib/active_interaction/filters/hash_filter.rb +11 -1
- data/lib/active_interaction/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 97372d5791c4be395f259a22c60747a6dfcfc54d
|
4
|
+
data.tar.gz: fa1052eb313ccc7ed6011ae9565475baea6e498c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d97ff17b686cf96e42a93c6b6780d99a1a6c9b6e7c8f080ccff7400da960eb6ecc9577836cb36eaf1a80cf9048c840b806ff4b5135838ec2734b5c2c580da3b8
|
7
|
+
data.tar.gz: 7fbe1d890c31c34433e33f1cfd8f8ed22efaea8954bda90df2dedb19fb276aa75fa74bd48b45cf174066d0eca0ac443568723b8dbe811a139fccc070fb35cd67
|
data/CHANGELOG.md
CHANGED
@@ -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.
|
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
|
data/lib/active_interaction.rb
CHANGED
@@ -30,7 +30,7 @@ module ActiveInteraction
|
|
30
30
|
def cast(value)
|
31
31
|
case value
|
32
32
|
when Hash
|
33
|
-
value = value
|
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
|