synced 0.0.6 → 0.0.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/synced/model.rb +1 -1
- data/lib/synced/synchronizer.rb +5 -1
- data/lib/synced/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ac4ba6fd11df9ce17296c4afbfb4740cfb919035
|
4
|
+
data.tar.gz: 390c0578545827b5a88169ae09535c917897196a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f3109f17e56fbd5fa37ffeb6655a963ffd584e0af775bf5b7bfe98c1b64f99785e47892d2b57b775774d1e6bfc909e19a0d9881349e5d6a15e6df5fa587d1ad3
|
7
|
+
data.tar.gz: c94a411274efb0e4f94c03675dc66bbdcc4caef474ad108b0759be7f79f50e1289f4ae6ece55ce16324e700f443cd21e9203302f84ed223714c7fbd4d03e6b22
|
data/lib/synced/model.rb
CHANGED
@@ -60,7 +60,7 @@ module Synced
|
|
60
60
|
# Rental.synchronize(remote: remote_rentals, scope: website)
|
61
61
|
#
|
62
62
|
def synchronize(remote: nil, model_class: self, scope: nil, remove: false,
|
63
|
-
include: nil, api:
|
63
|
+
include: nil, api: nil)
|
64
64
|
options = {
|
65
65
|
scope: scope,
|
66
66
|
id_key: synced_id_key,
|
data/lib/synced/synchronizer.rb
CHANGED
@@ -79,7 +79,11 @@ module Synced
|
|
79
79
|
|
80
80
|
def local_attributes_mapping(remote)
|
81
81
|
if @local_attributes.is_a?(Hash)
|
82
|
-
Hash[
|
82
|
+
Hash[
|
83
|
+
@local_attributes.map do |k, v|
|
84
|
+
[k, v.respond_to?(:call) ? v.call(remote) : remote[v]]
|
85
|
+
end
|
86
|
+
]
|
83
87
|
else
|
84
88
|
Hash[Array(@local_attributes).map { |k| [k, remote[k]] }]
|
85
89
|
end
|
data/lib/synced/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: synced
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sebastien Grosjean
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-07-
|
12
|
+
date: 2014-07-30 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|