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: a9002b84bec6ce71116bd2f797632fd473e47de9
4
- data.tar.gz: 13ec78e97adc867930f6c1c392f73e68fdc7cc15
3
+ metadata.gz: 29e4b39bc19f6cbe5c7480b4bf43498e7d3013e5
4
+ data.tar.gz: 4e705bc6abe8355b03c3c7818869aec7797bd4d4
5
5
  SHA512:
6
- metadata.gz: cd8360a22da901c3e60fa56d58bfb7318645ef42ebb17c7b4c32e7893e45eb37d49a33383f1f3bef3c9bf8c062be298cc3a1fba9056194994d4410fc7a49eab3
7
- data.tar.gz: 87e22933a0e425d6af9e58d82d0248fd9db17012544a923ce423e260d04b174d55a369caea3998a422a2018d73d429039ef8c8817ab9e602963a2997ee3264c7
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, '0', /\Afalse\z/i
24
+ when FalseClass, /\A(?:0|false|off)\z/i
25
25
  false
26
- when TrueClass, '1', /\Atrue\z/i
26
+ when TrueClass, /\A(?:1|true|on)\z/i
27
27
  true
28
28
  else
29
29
  super
@@ -6,5 +6,5 @@ module ActiveInteraction
6
6
  # The version number.
7
7
  #
8
8
  # @return [Gem::Version]
9
- VERSION = Gem::Version.new('3.1.1')
9
+ VERSION = Gem::Version.new('3.2.0')
10
10
  end
@@ -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.1.1
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-05-31 00:00:00.000000000 Z
12
+ date: 2016-06-07 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activemodel