reactive-record 0.7.7 → 0.7.8
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: 5cf9494b1346a998d25e757a2753208692fde69b
|
4
|
+
data.tar.gz: 46ab8888020d0076cd9f53fea513519f8eba9910
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0910cbdc2a1a2fb315b0ebcc055d6f6be39ad8091ffb428f72e5898417f81a0a8e14fbaf83c49e39e9d6dc6dafc1c46fd4e6f22495ff9dbd1ab1fa26f642a495
|
7
|
+
data.tar.gz: 0361491939e7ae8af1a226f4e59db7f6345a16f9237be03b5cda683919b1a0657c338600649d5891a0c3108236e33de29a505e283e8d09e838018c0a41a772f6
|
@@ -178,20 +178,25 @@ module ReactiveRecord
|
|
178
178
|
end
|
179
179
|
end
|
180
180
|
end
|
181
|
+
was_changed = changed2(@attributes.dup)
|
181
182
|
attributes[attribute] = value
|
182
183
|
React::State.set_state(self, attribute, value) unless data_loading?
|
184
|
+
React::State.set_state(self, self, :changed) unless data_loading? or (was_changed == changed2({attribute => value}))
|
183
185
|
end
|
184
186
|
value
|
185
187
|
end
|
186
|
-
|
188
|
+
|
187
189
|
def changed?(*args)
|
188
|
-
|
190
|
+
changed2(if args.count == 0
|
189
191
|
React::State.get_state(self, self)
|
190
192
|
@attributes.dup
|
191
193
|
else
|
192
194
|
React::State.get_state(@attributes, args[0])
|
193
195
|
{args[0] => @attributes[args[0]]}
|
194
|
-
end
|
196
|
+
end)
|
197
|
+
end
|
198
|
+
|
199
|
+
def changed2(attrs)
|
195
200
|
attrs.each do |attribute, value|
|
196
201
|
if association = @model.reflect_on_association(attribute) and association.collection? and value
|
197
202
|
return true unless value == @synced_attributes[attribute]
|