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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2075259c1aca0cf57a6228678bde16380e0c48ab
4
- data.tar.gz: 41355156201bbdb779e221fc68007334171237e8
3
+ metadata.gz: ac4ba6fd11df9ce17296c4afbfb4740cfb919035
4
+ data.tar.gz: 390c0578545827b5a88169ae09535c917897196a
5
5
  SHA512:
6
- metadata.gz: 13247ea4001345d7787945c28b18f5ce9514ea9cdd2689ddb32f9356fe2c65af5bbf5eb72404285aa5b605fac310bafad405281d95f66a0793436778b441446f
7
- data.tar.gz: aba2f3e3f5a14db5e8bb81aa7c3a654fe5a0990647ffd147428229416423f1a86f2956535970e5721e58c639f059ae47c82441b0473717c2a114da4585414426
6
+ metadata.gz: f3109f17e56fbd5fa37ffeb6655a963ffd584e0af775bf5b7bfe98c1b64f99785e47892d2b57b775774d1e6bfc909e19a0d9881349e5d6a15e6df5fa587d1ad3
7
+ data.tar.gz: c94a411274efb0e4f94c03675dc66bbdcc4caef474ad108b0759be7f79f50e1289f4ae6ece55ce16324e700f443cd21e9203302f84ed223714c7fbd4d03e6b22
@@ -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: api)
63
+ include: nil, api: nil)
64
64
  options = {
65
65
  scope: scope,
66
66
  id_key: synced_id_key,
@@ -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[@local_attributes.map { |k, v| [k, remote[v]] }]
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
@@ -1,3 +1,3 @@
1
1
  module Synced
2
- VERSION = "0.0.6"
2
+ VERSION = "0.0.7"
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: 0.0.6
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-29 00:00:00.000000000 Z
12
+ date: 2014-07-30 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails