json_attributes 0.1.1 → 0.1.2

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: db24fc34e1e7b33164e8cfee8f345b156b849c09
4
- data.tar.gz: d9ea002dfb0ecb40ecbd31679d87fc7847de9085
3
+ metadata.gz: f8b59d1c2559fe87fff720e6245cad29ff432ea7
4
+ data.tar.gz: ee50a92852bf4feb5dc7008bb46e35160d328e04
5
5
  SHA512:
6
- metadata.gz: dc6fca4c0f722c788d42658c053dfe4310a98648ddc87cc72c869fe9e4826f6b03dcbb218146499ccf276ecd870e7e20616ea2253b4170d683082465639f5da7
7
- data.tar.gz: 6d0bc8d2a39d7454d284f26c283407fdb31d11c2f5ffefa67918b92a12ca0f82f6a7215d637b40c519df3413fcc6d368911e56fdde31bcc7cfbc7cb8e750f0cc
6
+ metadata.gz: 6e68c502283383a03a8fdafe1f9dfe96b159cf6edea1abdd8fb992ff9a332b438faf5efead7964c2160bea5626aa6037ac5cf39ae6ebcfd92749e249625265a3
7
+ data.tar.gz: 190eaa8b16e078f44d7e4f8f0d38106ed2546a371a7ef3c05cbed880f27685647ccd5a50c48bafc408cc7704251795810850c3ebba6f0924c3910936401ecebe
data/CHANGELOG.md CHANGED
@@ -1,3 +1,8 @@
1
+ ### VERSION 0.1.2
2
+
3
+ * Bug fix
4
+ * When you initialize a new model `json_attributes` field is nil.
5
+
1
6
  ### VERSION 0.1.1
2
7
 
3
8
  * Bug fix
@@ -2,7 +2,7 @@ module JsonAttributes::LegacyAttributes
2
2
 
3
3
  def attributes
4
4
  _json_attrs = if self.class.instance_variable_get(:@field)
5
- self.send(self.class.instance_variable_get(:@field)).dup
5
+ self.send(self.class.instance_variable_get(:@field)).try(:dup) || {}
6
6
  else
7
7
  {}
8
8
  end.with_indifferent_access
@@ -1,3 +1,3 @@
1
1
  module JsonAttributes
2
- VERSION = '0.1.1'
2
+ VERSION = '0.1.2'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: json_attributes
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joel AZEMAR
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2015-08-12 00:00:00.000000000 Z
11
+ date: 2015-10-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord