activerecord_hstore_boolean 0.0.3 → 0.0.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: 070fab65620353977cb8c0d3202a27e3707c4ea7
4
- data.tar.gz: 38dd0430a3f10575d10dd5dfbc439704f3ef905a
3
+ metadata.gz: 695aa75ecb9fb867282d35ad09324488055e62bc
4
+ data.tar.gz: 2135a5bfef48e7f2d38159a49dd14190dbbd13be
5
5
  SHA512:
6
- metadata.gz: cced38428ed113357f87d96e8e21264dfd667edf5d36ef6a8c612477bcb2dc8dfc8df22e4d6ecacd6da605f6ea2ef4d9c81c371c0092e9d80347621f0de70f7d
7
- data.tar.gz: 87a2bb45a463e67b489c0071546f4018470763020707c502f7e9c702cf4d96937ebac1c4aa4355f98ff24939dce4163e34098d84b1b934d83400e2b166d13823
6
+ metadata.gz: bb05cf19d2acbf71f1e64c4eec241acd22473c0bc03828f0cb39239f6ff9eda57450e1f90cd618235ae8ea91b6e55b6757fc3c190d318e5f416cbd778b07407f
7
+ data.tar.gz: 06731375893c2106a4d55b15ec5699a73386ed78ca6f2c3f795661984efa33f3c2c717c8985c8de35479eb06fabd881d1e62df139babd7da59b52d521169ea9f
@@ -20,7 +20,7 @@ module ActiverecordHstoreBoolean
20
20
 
21
21
  define_method(attr_name) do
22
22
  self[attr_name].each do |key, value|
23
- self[attr_name][key] = value == STORED_TRUE_VALUE if keys.include?(key.to_s)
23
+ self[attr_name][key] = [STORED_TRUE_VALUE, true].include?(value) if keys.include?(key.to_s)
24
24
  end
25
25
  end
26
26
  end
@@ -1,3 +1,3 @@
1
1
  module ActiverecordHstoreBoolean
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.4"
3
3
  end
@@ -12,7 +12,6 @@ describe ActiverecordHstoreBoolean do
12
12
  expect(product.properties['popular']).to be_true
13
13
  expect(product.properties['color']).to eq 'white'
14
14
  end
15
-
16
15
  end
17
16
 
18
17
  it 'normalize falue value' do
@@ -21,4 +20,13 @@ describe ActiverecordHstoreBoolean do
21
20
  expect(product.properties['popular']).to be_false
22
21
  expect(product.properties['color']).to eq 'white'
23
22
  end
23
+
24
+ context 'get value twice' do
25
+ it do
26
+ product = Product.create(properties: { popular: true, color: 'white' })
27
+ product.reload
28
+ product.properties['popular']
29
+ expect(product.properties['popular']).to be_true
30
+ end
31
+ end
24
32
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: activerecord_hstore_boolean
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Meck