serialize_yaml2json 0.1.0 → 0.1.1

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: f1c63053c753cb5b33e5332ec4a11ee4545f045f
4
- data.tar.gz: fb5dbe5d682bbf7155c448b8dcf3c1711b2c0cbb
3
+ metadata.gz: c5190c3126d7c9c0aacec40659c465002996c455
4
+ data.tar.gz: f14323be9995a8dfef8af33bab6e3f7ea039e525
5
5
  SHA512:
6
- metadata.gz: 0d76f9ece3db7db6228d622ec333760d2128b91548f552a3c40b7303b7c26422a0bcaa32bce20c51e5e1217af9d4d16856551ba4809439edb1ef6b2778f8ac02
7
- data.tar.gz: 292a29b4eb082eb87f4541430d302340a7d007ad252f216c657ceaa1059d626dc037d5baaba6d049fbca62702f96ed571e6ce972027e6258f8c66eee51bc66ef
6
+ metadata.gz: 9fbe6848e2314d2ee6ce03e9d09366768d2d56f606e2e4825a01c61188984306be90abc7aadb9dc5fd8453fbc688533086a190142de54d56fab21cf2e1339329
7
+ data.tar.gz: ed61216750c7023370c02308671cce8feb2d0d0f3d575ac541b0a01109b2fc2cf5e828d3fa8f5a92fd770a6597ff78a37ddaf3f19c48e6aa26b657282aa7239a
@@ -15,7 +15,7 @@ module SerializeYAML2JSON
15
15
  else
16
16
  obj = ::ActiveRecord::Coders::JSON.load(yaml_or_json)
17
17
  end
18
- obj.with_indifferent_access
18
+ obj.respond_to?(:with_indifferent_access) ? obj.with_indifferent_access : obj
19
19
  end
20
20
 
21
21
  end
@@ -1,3 +1,3 @@
1
1
  module SerializeYAML2JSON
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
@@ -39,4 +39,16 @@ describe SerializeYAML2JSON do
39
39
 
40
40
  end
41
41
 
42
+ describe "with a nil value" do
43
+ before do
44
+ subject.class.connection.update("UPDATE widgets SET data = NULL")
45
+ subject.reload
46
+ end
47
+
48
+ it "loads correctly" do
49
+ expect(subject.data).to eq nil
50
+ end
51
+
52
+ end
53
+
42
54
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: serialize_yaml2json
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Philip Hallstrom