reactive-record 0.7.32 → 0.7.33
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: 6f071187fbe9b4f2c5a5ae000a389e429986e34d
|
4
|
+
data.tar.gz: 5c35aad8d66556df49791a83d05f0569e05adb98
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bc6431f25bf37975dcf2f294e0cb0feb202730cca3742bff0dda4507058308e5fb48d6f0c677f445f0af58734983fcff093a230145d6db7bfca877e93d411b83
|
7
|
+
data.tar.gz: b194befb441790f8305e4c8909f7eaacb631978d8629a86691c8e0fb3e22085ee3b6230ef991059710fdd61e294dd416b222b893d7b9b9d4197b8a6468ed974c
|
@@ -234,7 +234,7 @@ module ReactiveRecord
|
|
234
234
|
def update_attribute(attribute, *args)
|
235
235
|
value = args[0]
|
236
236
|
if args.count != 0 and data_loading?
|
237
|
-
if aggregation = model.reflect_on_aggregation(attribute) and !(aggregation.klass < ActiveRecord::Base)
|
237
|
+
if (aggregation = model.reflect_on_aggregation(attribute)) and !(aggregation.klass < ActiveRecord::Base)
|
238
238
|
@synced_attributes[attribute] = aggregation.deserialize(aggregation.serialize(value))
|
239
239
|
else
|
240
240
|
@synced_attributes[attribute] = value
|
@@ -245,12 +245,12 @@ module ReactiveRecord
|
|
245
245
|
return
|
246
246
|
end
|
247
247
|
changed = if args.count == 0
|
248
|
-
if association = @model.reflect_on_association(attribute) and association.collection?
|
248
|
+
if (association = @model.reflect_on_association(attribute)) and association.collection?
|
249
249
|
attributes[attribute] != @synced_attributes[attribute]
|
250
250
|
else
|
251
251
|
!attributes[attribute].backing_record.changed_attributes.empty?
|
252
252
|
end
|
253
|
-
elsif association = @model.reflect_on_association(attribute) and association.collection?
|
253
|
+
elsif (association = @model.reflect_on_association(attribute)) and association.collection?
|
254
254
|
value != @synced_attributes[attribute]
|
255
255
|
else
|
256
256
|
!@synced_attributes.has_key?(attribute) or @synced_attributes[attribute] != value
|
@@ -324,10 +324,10 @@ module ReactiveRecord
|
|
324
324
|
end
|
325
325
|
|
326
326
|
def revert
|
327
|
-
@
|
327
|
+
@changed_attributes.each do |attribute|
|
328
328
|
@ar_instance.send("#{attribute}=", @synced_attributes[attribute])
|
329
|
+
@attributes.delete(attribute) unless @synced_attributes.has_key?(attribute)
|
329
330
|
end
|
330
|
-
@attributes.delete_if { |attribute, value| !@synced_attributes.has_key?(attribute) }
|
331
331
|
@changed_attributes = []
|
332
332
|
@errors = nil
|
333
333
|
end
|
@@ -93,6 +93,7 @@ module ReactiveRecord
|
|
93
93
|
all << item unless all.include? item # does this use == if so we are okay...
|
94
94
|
if backing_record and @owner and @association and inverse_of = @association.inverse_of and item.attributes[inverse_of] != @owner
|
95
95
|
current_association = item.attributes[inverse_of]
|
96
|
+
backing_record.virgin = false unless backing_record.data_loading?
|
96
97
|
backing_record.update_attribute(inverse_of, @owner)
|
97
98
|
current_association.attributes[@association.attribute].delete(item) if current_association and current_association.attributes[@association.attribute]
|
98
99
|
@owner.backing_record.update_attribute(@association.attribute) # forces a check if association contents have changed from synced values
|
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.33
|
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-12-
|
11
|
+
date: 2015-12-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|