active_interaction 3.1.1 → 3.2.0
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: 29e4b39bc19f6cbe5c7480b4bf43498e7d3013e5
|
4
|
+
data.tar.gz: 4e705bc6abe8355b03c3c7818869aec7797bd4d4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ea5472b8cbf5ad563b43e0e8b5cd97da6a9c7284bd3c5134271ef7ed92bc7342b3c5e1f5b5e48805bac7f9dc4c8ca977798704cd914f4488f7759630e25b5ac2
|
7
|
+
data.tar.gz: 046f316bd5cf3962bd083a6afb4876bbf2c73c7a78b7ad47fb8aefa2f7d38301a4c198711c1bcef2c300e5e0c2b2989f50790bd79c09f421d3b68c5587a625ec
|
@@ -21,9 +21,9 @@ module ActiveInteraction
|
|
21
21
|
|
22
22
|
def cast(value, _interaction)
|
23
23
|
case value
|
24
|
-
when FalseClass,
|
24
|
+
when FalseClass, /\A(?:0|false|off)\z/i
|
25
25
|
false
|
26
|
-
when TrueClass,
|
26
|
+
when TrueClass, /\A(?:1|true|on)\z/i
|
27
27
|
true
|
28
28
|
else
|
29
29
|
super
|
@@ -8,7 +8,7 @@ describe ActiveInteraction::BooleanFilter, :filter do
|
|
8
8
|
|
9
9
|
describe '#cast' do
|
10
10
|
context 'falsey' do
|
11
|
-
[false, '0', 'false', 'FALSE'].each do |value|
|
11
|
+
[false, '0', 'false', 'FALSE', 'off', 'OFF'].each do |value|
|
12
12
|
it "returns false for #{value.inspect}" do
|
13
13
|
expect(filter.cast(value, nil)).to be_falsey
|
14
14
|
end
|
@@ -16,7 +16,7 @@ describe ActiveInteraction::BooleanFilter, :filter do
|
|
16
16
|
end
|
17
17
|
|
18
18
|
context 'truthy' do
|
19
|
-
[true, '1', 'true', 'TRUE'].each do |value|
|
19
|
+
[true, '1', 'true', 'TRUE', 'on', 'ON'].each do |value|
|
20
20
|
it "returns true for #{value.inspect}" do
|
21
21
|
expect(filter.cast(value, nil)).to be_truthy
|
22
22
|
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: 3.
|
4
|
+
version: 3.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Aaron Lasseigne
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2016-
|
12
|
+
date: 2016-06-07 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activemodel
|