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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6890aab53e44627ad247302ff300f2d161436a92
4
- data.tar.gz: 65a59056502cdca3cde21ae58aa5f45eae9971b5
3
+ metadata.gz: 1ab9aa2facc1afc7131e87f5a5d0172b6f1128bd
4
+ data.tar.gz: c527f9a1459dace9a26aa4969a3fc21ed5e598a4
5
5
  SHA512:
6
- metadata.gz: f14a1725b313847448388d1df28051c8d59ac2c4e420076490825a42d02493ea8f07194ca4ca88779c9de9759b610b10afd0bb0a0954cdb1a6adc88f0528ff68
7
- data.tar.gz: 00b0999b39c3e4e6cf08eb02ccf076820b08915cbdd311d1d73710ddc44702b50ad5270981b737efe8ccab2711684b2f1bf777945f47f5c5b89bce612fa1a938
6
+ metadata.gz: a1dcb83e4d53ac213cfa512b6682ceba9a8adef709aa4e2225c1bb83853bf7cc1d863f0e72cab10571b762a3d56f8fbdef15b8183a52427a01fedfff89568873
7
+ data.tar.gz: eb8b8fab78c71c261662fbf005bdf978ccf23f787e467df154d360a4bd470c5eca8053a900fa32791ce1bd0b2055af2a07a39c48642b31b278fb5df7bd3c8516
@@ -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
- @perform_request = options[:remote].nil?
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
 
@@ -1,3 +1,3 @@
1
1
  module Synced
2
- VERSION = "1.1.2"
2
+ VERSION = "1.1.3"
3
3
  end
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.2
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-10-05 00:00:00.000000000 Z
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: