ninja-model 1.0.4 → 1.0.5

Sign up to get free protection for your applications and to get access to all the features.
@@ -12,7 +12,7 @@ module NinjaModel
12
12
  r
13
13
  }
14
14
  h['@attributes'] = @attributes.inject({}) { |a, (k, v)|
15
- a[k] = ActiveSupport::JSON.encode(v)
15
+ a[k] = read_attribute(k)
16
16
  a
17
17
  }
18
18
  ActiveSupport::JSON.encode(h)
@@ -21,8 +21,16 @@ module NinjaModel
21
21
  def marshal_load(data)
22
22
  h = ActiveSupport::JSON.decode(data)
23
23
  h.each do |k, v|
24
- instance_variable_set(k, v)
24
+ if k.eql?('@attributes')
25
+ @attributes = {}
26
+ v.each do |n, x|
27
+ write_attribute(n, x)
28
+ end
29
+ else
30
+ instance_variable_set(k, v)
31
+ end
25
32
  end
33
+
26
34
  @association_cache = {}
27
35
  @aggregation_cache = {}
28
36
  end
@@ -1,3 +1,3 @@
1
1
  module NinjaModel
2
- VERSION = "1.0.4"
2
+ VERSION = "1.0.5"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ninja-model
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.4
4
+ version: 1.0.5
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -284,7 +284,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
284
284
  version: '0'
285
285
  segments:
286
286
  - 0
287
- hash: -180923263
287
+ hash: 641017985
288
288
  required_rubygems_version: !ruby/object:Gem::Requirement
289
289
  none: false
290
290
  requirements:
@@ -293,7 +293,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
293
293
  version: '0'
294
294
  segments:
295
295
  - 0
296
- hash: -180923263
296
+ hash: 641017985
297
297
  requirements: []
298
298
  rubyforge_project: ninja-model
299
299
  rubygems_version: 1.8.24