reactive-record 0.7.24 → 0.7.25

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 764bdacfc7a0653116882702f4d5ed982cd12cd1
4
- data.tar.gz: 7b481038117f876a4a002fe6314ed0bbb407cf3f
3
+ metadata.gz: f84ff0051d07fb7ba4f4f6b1dde0abd213b78a4a
4
+ data.tar.gz: a240b046e3f35e36d583180c85b2c968500f909c
5
5
  SHA512:
6
- metadata.gz: a545ede62898bf66cc953aa86b05ff559dd9b4f2f356aa9c93efbed79697b2da6ceb6cec8167889d2dc9d822ead2cd8e195b2971d8b7c1cea69731be87574c5d
7
- data.tar.gz: b4a4136d8ae962647c427d49f239a593d2404da3195e49ff69b637c8bfeae57f11914946d2a687d431bada263624d1574989b3d54b0e929ba20ef4a71d869931
6
+ metadata.gz: d534356c70ce1ed16e29bfdfc9badf5bb43a43a5d257dfde769899ee47bd6a17b2627a46e689f6eba468d19d141587f644982b3b68faf79fad5162e2837cff17
7
+ data.tar.gz: bb3e9292acf24f4359eca6f3fc59ad18408c6419a8af65338e077530f9e753918ffc23d3f475011c5670a74dd067664953d256ab740f852f2c08936a61f590c7
@@ -182,6 +182,7 @@ module ReactiveRecord
182
182
  self
183
183
  end
184
184
  rescue Exception => e
185
+ #binding.pry if cache_item.value and cache_item.value != []
185
186
  raise "ReactiveRecord exception caught when applying #{method} to db objects #{e}" if cache_item.value and cache_item.value != []
186
187
  representative
187
188
  end
@@ -282,7 +283,6 @@ module ReactiveRecord
282
283
  if id_value = tree["id"] and id_value.is_a? Array
283
284
  target.id = id_value.first
284
285
  end
285
-
286
286
  tree.each do |method, value|
287
287
  method = JSON.parse(method) rescue method
288
288
  new_target = nil
@@ -313,6 +313,10 @@ module ReactiveRecord
313
313
  association = target.class.reflect_on_association(method)
314
314
  new_target = association.klass.find(value[:id].first)
315
315
  target.send "#{method}=", new_target
316
+ elsif !(target.class < ActiveRecord::Base)
317
+ new_target = target.send *method
318
+ # value is an array if scope returns nil, so we destroy the bogus record
319
+ new_target.destroy and new_target = nil if value.is_a? Array
316
320
  else
317
321
  new_target = target.send("#{method}=", target.send(method))
318
322
  end
@@ -1,3 +1,3 @@
1
1
  module ReactiveRecord
2
- VERSION = "0.7.24"
2
+ VERSION = "0.7.25"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: reactive-record
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.24
4
+ version: 0.7.25
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mitch VanDuyn
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-10-09 00:00:00.000000000 Z
11
+ date: 2015-10-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails