restforce-db 3.1.3 → 3.1.4

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: 386e259816079ce1f9b7eeb1ad6028daa552bfb7
4
- data.tar.gz: 3b9ac175fdd418fbefab7b3e865d88b2230e4571
3
+ metadata.gz: 54adddb1c2bfbeb30e483647871635c25c699ac9
4
+ data.tar.gz: c0c9d14b7f758b0c2347a304a92d7e797317c682
5
5
  SHA512:
6
- metadata.gz: 0c1ae937112b3200347699f59d8bd5a878dcd8e6b8ed21b72ef3f9cb8c5824eb31f89939ecfb799fc6f9db9994bcb32986d21494394b8e88e2df68141b584146
7
- data.tar.gz: 38d120a7854a2f27306c023f73bce721a75112d348986be35ab8d2d912aa115bbd14847eafd5281451e64ca9e613ec116fbfbea38fd90980b55c7cd35c29866c
6
+ metadata.gz: 63f141e17b73c5bb41f950610cc133e940da5df78ecfc526503e36b5ebe7d6238897af608d16e4b40a38a7fb7fa47f973f7aa58255105f413c42197433541842
7
+ data.tar.gz: 2f0f3d913be6828ac706e8b3805693118a4df5aaa462e0bc94ef0d88e2c254dff43ec8708cbdd059bbb5b2265340ba4c28ec15a968aafb5fdcbdceb6496950cc
@@ -13,12 +13,18 @@ module Restforce
13
13
 
14
14
  # Public: Initialize a new RecordsChanged exception.
15
15
  #
16
+ # database_model - A String name of an ActiveRecord class.
16
17
  # salesforce_model - A String name of a Salesforce object type.
17
- # ids - An Array of String Salesforce IDs.
18
- def initialize(salesforce_model, ids)
19
- super <<-MESSAGE
18
+ # starts - A Time for the startpoint of the run.
19
+ # ends - A Time for the endpoint of the run.
20
+ # ids - A List of Strings representing Salesforce IDs.
21
+ def initialize(database_model, salesforce_model, starts, ends, *ids)
22
+ super <<-MESSAGE.sub(/\A\s+/, "").gsub(/\s+/, " ")
23
+ [#{database_model}|#{salesforce_model}]
24
+ (#{starts.utc.iso8601} to #{ends.utc.iso8601})
25
+
20
26
  The following #{salesforce_model} records were updated externally
21
- during the cleaning phase of synchronization: #{ids.join(', ')}
27
+ during the cleaning phase of synchronization: #{ids.join(' ')}
22
28
  MESSAGE
23
29
  end
24
30
 
@@ -80,7 +86,20 @@ module Restforce
80
86
  all_ids = all_salesforce_ids
81
87
 
82
88
  updated_ids = valid_ids - all_ids
83
- DB.logger.error(RecordsChanged.new(@mapping.salesforce_model, updated_ids)) unless updated_ids.empty?
89
+
90
+ unless updated_ids.empty?
91
+ exception = RecordsChanged.new(
92
+ @mapping.database_model,
93
+ @mapping.salesforce_model,
94
+ @runner.after,
95
+ @runner.before,
96
+ "CHANGED: #{updated_ids}",
97
+ "VALID: #{valid_ids}",
98
+ "ALL: #{all_ids}",
99
+ )
100
+
101
+ DB.logger.error(exception)
102
+ end
84
103
 
85
104
  all_ids - valid_ids
86
105
  end
@@ -3,7 +3,7 @@ module Restforce
3
3
  # :nodoc:
4
4
  module DB
5
5
 
6
- VERSION = "3.1.3"
6
+ VERSION = "3.1.4"
7
7
 
8
8
  end
9
9
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: restforce-db
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.1.3
4
+ version: 3.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Horner
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2015-06-30 00:00:00.000000000 Z
11
+ date: 2015-07-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord