reactive-record 0.7.28 → 0.7.29
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c9ffa135c5fea49dd89fd26b3180299ff96fa2be
|
4
|
+
data.tar.gz: 759eb5f92565c62ce05f23c5be19955f914142f0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dd724c0c0471ceea9c92d9c9a16f1c19f39a47ca40fe367f32c6eb504ef08141f45d69f48b52cfa9a0e99634e920cbddb87a776e75621870a7b9bcc7d4284a9c
|
7
|
+
data.tar.gz: 1a8b1bedcdafa10a6bfae116a1ace66e7f8eb7149dfc59e903b32753490cb4cd2814670404f372e60738a3a4b9b943baf767b21e02fe055322264c9ff2f990fd
|
@@ -64,7 +64,7 @@ module ActiveRecord
|
|
64
64
|
def scope(name, body)
|
65
65
|
singleton_class.send(:define_method, name) do | *args |
|
66
66
|
args = (args.count == 0) ? name : [name, *args]
|
67
|
-
ReactiveRecord::Base.class_scopes(self)[
|
67
|
+
ReactiveRecord::Base.class_scopes(self)[args] ||= ReactiveRecord::Collection.new(self, nil, nil, self, args)
|
68
68
|
end
|
69
69
|
singleton_class.send(:define_method, "#{name}=") do |collection|
|
70
70
|
ReactiveRecord::Base.class_scopes(self)[name] = collection
|
@@ -274,7 +274,7 @@ module ReactiveRecord
|
|
274
274
|
elsif aggregation
|
275
275
|
new_value = aggregation.serialize(value)
|
276
276
|
output_attributes[attribute] = new_value if record.changed?(attribute) or new_value != aggregation.serialize(record.synced_attributes[attribute])
|
277
|
-
elsif record.changed?(attribute)
|
277
|
+
elsif record.new? or record.changed?(attribute)
|
278
278
|
output_attributes[attribute] = value
|
279
279
|
end
|
280
280
|
end if record.new? || record.changed? || (record == record_being_saved && force)
|
@@ -416,7 +416,9 @@ module ReactiveRecord
|
|
416
416
|
aggregation.mapping.each_with_index do |pair, i|
|
417
417
|
record[pair.first] = value[i]
|
418
418
|
end
|
419
|
-
elsif key.to_s != "id"
|
419
|
+
elsif key.to_s != "id" and record.respond_to?("#{key}=") # server side methods can get included and we won't be able to write them...
|
420
|
+
# for example if you have a server side method foo, that you "get" on a new record, then later that value will get sent to the server
|
421
|
+
# we should track better these server side methods so this does not happen
|
420
422
|
record.send("#{key}=",value)
|
421
423
|
end
|
422
424
|
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.29
|
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-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|