draisine 0.7.12 → 0.7.13

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: e02084ec5e958abc727a572424931988333da60c
4
- data.tar.gz: 263bfc31d6f0f5728cefaae6533f929b1a23b4e7
3
+ metadata.gz: 349388970372f28032f02e6a653fa1529a643c1b
4
+ data.tar.gz: 8bd3d6b88275f563fe3ceee8ccf1c879bde8e881
5
5
  SHA512:
6
- metadata.gz: 667c1187aa466afe49c43335ca603786db538985481a288d4c14f781226ee05ff009ace0c970c603e61d027f146f7426b8b53ffd3e3727ab6a017742e2ef7ce1
7
- data.tar.gz: babbfc5d421361b6ff4d6cc7cfd6e70ffd1c615df1611dc675b0b7c6c9a4a6bad1b3e5efc967444cf94bd32f5c51f554911ccb00adafd07124d3933ff28d2347
6
+ metadata.gz: 1c266fd41d191db90dbf013f0c3c858777bbbdaeddfeece831e5c4927aa767c0551f400dcfff0c41773e66318ed5d2eea23e52a0b33f069a8365bd5c4f8bfcf9
7
+ data.tar.gz: 25c560339339969230a15611de02d05560246f13c8268348827a5bf70bb44593ef94c049f36153394082a0d50b48fc079919af4fcfa1c5a8863c7b6955bc73ce
@@ -49,10 +49,15 @@ module Draisine
49
49
  protected
50
50
 
51
51
  def get_updated_ids(start_date, end_date)
52
- mechanism.get_updated_ids(start_date, end_date) |
53
- model_class
54
- .where("updated_at >= ? AND updated_at <= ?", start_date, end_date)
55
- .uniq.pluck(:salesforce_id).compact
52
+ updated_ids = mechanism.get_updated_ids(start_date, end_date)
53
+ if Draisine.poll_locally_updated_ids?
54
+ updated_ids |= model_class
55
+ .where("updated_at >= ? AND updated_at <= ?", start_date, end_date)
56
+ .uniq
57
+ .pluck(:salesforce_id)
58
+ .compact
59
+ end
60
+ updated_ids
56
61
  end
57
62
 
58
63
  def get_deleted_ids(start_date, end_date)
@@ -44,6 +44,15 @@ EOM
44
44
  @job_error_handler = handler
45
45
  end
46
46
 
47
+ def self.poll_locally_updated_ids?
48
+ @poll_locally_updated_ids = true if @poll_locally_updated_ids.nil?
49
+ @poll_locally_updated_ids
50
+ end
51
+
52
+ def self.poll_locally_updated_ids=(value)
53
+ @poll_locally_updated_ids = value
54
+ end
55
+
47
56
  def self.sync_callback
48
57
  @sync_callback ||= proc {|type, salesforce_id, options| }
49
58
  end
@@ -1,3 +1,3 @@
1
1
  module Draisine
2
- VERSION = "0.7.12"
2
+ VERSION = "0.7.13"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: draisine
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.12
4
+ version: 0.7.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mark Abramov
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-01-09 00:00:00.000000000 Z
11
+ date: 2017-02-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler