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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4adec3ae22c841db3e4c32b7d0ef7afa6bd13040
|
4
|
+
data.tar.gz: e918de7c182f59c682eeeffac6b69a0a51c67d9d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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.
|
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
|
data/lib/active_interaction.rb
CHANGED
@@ -30,7 +30,8 @@ module ActiveInteraction
|
|
30
30
|
def cast(value)
|
31
31
|
case value
|
32
32
|
when Hash
|
33
|
-
value = value.
|
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])
|
@@ -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
|