synced 1.1.2 → 1.1.3
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/strategies/full.rb +4 -2
- data/lib/synced/version.rb +1 -1
- metadata +2 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1ab9aa2facc1afc7131e87f5a5d0172b6f1128bd
|
4
|
+
data.tar.gz: c527f9a1459dace9a26aa4969a3fc21ed5e598a4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a1dcb83e4d53ac213cfa512b6682ceba9a8adef709aa4e2225c1bb83853bf7cc1d863f0e72cab10571b762a3d56f8fbdef15b8183a52427a01fedfff89568873
|
7
|
+
data.tar.gz: eb8b8fab78c71c261662fbf005bdf978ccf23f787e467df154d360a4bd470c5eca8053a900fa32791ce1bd0b2055af2a07a39c48642b31b278fb5df7bd3c8516
|
data/lib/synced/model.rb
CHANGED
@@ -102,7 +102,7 @@ module Synced
|
|
102
102
|
def synchronize(options = {})
|
103
103
|
options.symbolize_keys!
|
104
104
|
options.assert_valid_keys(:api, :fields, :include, :remote, :remove,
|
105
|
-
:scope, :strategy, :search_params)
|
105
|
+
:scope, :strategy, :search_params, :association_sync)
|
106
106
|
options[:remove] = synced_remove unless options.has_key?(:remove)
|
107
107
|
options[:include] = Array.wrap(synced_include) unless options.has_key?(:include)
|
108
108
|
options[:fields] = Array.wrap(synced_fields) unless options.has_key?(:fields)
|
@@ -60,7 +60,8 @@ module Synced
|
|
60
60
|
@fields = options[:fields]
|
61
61
|
@remove = options[:remove]
|
62
62
|
@associations = Array.wrap(options[:associations])
|
63
|
-
@
|
63
|
+
@association_sync = options[:association_sync]
|
64
|
+
@perform_request = options[:remote].nil? && !@association_sync
|
64
65
|
@remote_objects = Array.wrap(options[:remote]) unless @perform_request
|
65
66
|
@globalized_attributes = synced_attributes_as_hash(options[:globalized_attributes])
|
66
67
|
@search_params = options[:search_params]
|
@@ -97,7 +98,8 @@ module Synced
|
|
97
98
|
def synchronize_associations(remote, local_object)
|
98
99
|
@associations.each do |association|
|
99
100
|
klass = association.to_s.classify.constantize
|
100
|
-
klass.synchronize(remote: remote[association], scope: local_object, remove: @remove
|
101
|
+
klass.synchronize(remote: remote[association], scope: local_object, remove: @remove,
|
102
|
+
association_sync: true)
|
101
103
|
end
|
102
104
|
end
|
103
105
|
|
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: 1.1.
|
4
|
+
version: 1.1.3
|
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: 2015-
|
12
|
+
date: 2015-12-07 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|
@@ -212,4 +212,3 @@ signing_key:
|
|
212
212
|
specification_version: 4
|
213
213
|
summary: Keep your BookingSync Application synced with BookingSync.
|
214
214
|
test_files: []
|
215
|
-
has_rdoc:
|