reactive-record 0.7.24 → 0.7.25
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/reactive_record/server_data_cache.rb +5 -1
- data/lib/reactive_record/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f84ff0051d07fb7ba4f4f6b1dde0abd213b78a4a
|
4
|
+
data.tar.gz: a240b046e3f35e36d583180c85b2c968500f909c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
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.
|
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-
|
11
|
+
date: 2015-10-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|