synced 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/synced/synchronizer.rb +6 -2
- data/lib/synced/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9b354ac0d6a11182622ca00701ea3e659280017b
|
4
|
+
data.tar.gz: 106c323663177869a9d0f458edafa4bbb81f2b2c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a583f7a72398c4b0bd0103eea0dbf6124305c24cf0615ab7987409b68c97c202a6bb00cd27a699196d33dc5f53f88cef2cbbdbc8ac7dcdccb06ae3e3a01d1a0f
|
7
|
+
data.tar.gz: 7ebde8714a3f64bce1fd301fd0f31965fda175e42ff6decf5735661a699f29826266632083516509a799370dfd382671533b9ce10355e365ef9ee846373fdf2f
|
data/lib/synced/synchronizer.rb
CHANGED
@@ -42,7 +42,7 @@ module Synced
|
|
42
42
|
@remove = options[:remove]
|
43
43
|
@only_updated = options[:only_updated]
|
44
44
|
@include = options[:include]
|
45
|
-
@local_attributes =
|
45
|
+
@local_attributes = options[:local_attributes]
|
46
46
|
@associations = Array(options[:associations])
|
47
47
|
@remote_objects = Array(remote_objects) if remote_objects
|
48
48
|
@request_performed = false
|
@@ -75,7 +75,11 @@ module Synced
|
|
75
75
|
private
|
76
76
|
|
77
77
|
def local_attributes_mapping(remote)
|
78
|
-
|
78
|
+
if @local_attributes.is_a?(Hash)
|
79
|
+
Hash[@local_attributes.map { |k, v| [k, remote[v]] }]
|
80
|
+
else
|
81
|
+
Hash[Array(@local_attributes).map { |k| [k, remote[k]] }]
|
82
|
+
end
|
79
83
|
end
|
80
84
|
|
81
85
|
def default_attributes_mapping(remote)
|
data/lib/synced/version.rb
CHANGED