reactive-record 0.7.29 → 0.7.30
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:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: b6bb1cc3265c0141b9757c88ceb4e7fcbf958d00
|
|
4
|
+
data.tar.gz: 6c55106b465a686d47393255977e7044d1841ce6
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 1721fdfe1bc81b417c9c722efa2b1ec89a8726cedf474d5811a2cd3bdfba30506343d3b33c54115a575ca8d53f3596ffbcaf3f702993fadee41f86e424fa8852
|
|
7
|
+
data.tar.gz: 42145c75a12201d4c8d699019dc16f12a86a4f6c0d55e16457c82f3cf6033d98091b5c8fd4496f94feaa888502fd3bccecec62c0fa00c78e5ce688f7a079d09c
|
|
@@ -263,11 +263,15 @@ module ReactiveRecord
|
|
|
263
263
|
record.attributes.each do |attribute, value|
|
|
264
264
|
if association = record.model.reflect_on_association(attribute)
|
|
265
265
|
if association.collection?
|
|
266
|
-
value.each
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
266
|
+
value.each do |assoc|
|
|
267
|
+
add_new_association.call(record, attribute, assoc.backing_record) if assoc.changed?(association.inverse_of) or assoc.new?
|
|
268
|
+
end
|
|
269
|
+
elsif record.new? || record.changed?(attribute) || (record == record_being_saved && force)
|
|
270
|
+
if value.nil?
|
|
271
|
+
output_attributes[attribute] = nil
|
|
272
|
+
else
|
|
273
|
+
add_new_association.call record, attribute, value.backing_record
|
|
274
|
+
end
|
|
271
275
|
end
|
|
272
276
|
elsif aggregation = record.model.reflect_on_aggregation(attribute) and (aggregation.klass < ActiveRecord::Base)
|
|
273
277
|
add_new_association.call record, attribute, value.backing_record unless value.nil?
|
|
@@ -357,7 +361,7 @@ module ReactiveRecord
|
|
|
357
361
|
object.send(method)
|
|
358
362
|
end
|
|
359
363
|
end
|
|
360
|
-
if id and (found.nil? or !(found.class <= model) or found.id != id)
|
|
364
|
+
if id and (found.nil? or !(found.class <= model) or found.id.to_s != id.to_s)
|
|
361
365
|
raise "Inconsistent data sent to server - #{model.name}.find(#{id}) != [#{vector}]"
|
|
362
366
|
end
|
|
363
367
|
found
|
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.30
|
|
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-
|
|
11
|
+
date: 2015-11-04 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rails
|