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 +4 -4
- data/lib/restforce/db/cleaner.rb +24 -5
- data/lib/restforce/db/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 54adddb1c2bfbeb30e483647871635c25c699ac9
|
4
|
+
data.tar.gz: c0c9d14b7f758b0c2347a304a92d7e797317c682
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 63f141e17b73c5bb41f950610cc133e940da5df78ecfc526503e36b5ebe7d6238897af608d16e4b40a38a7fb7fa47f973f7aa58255105f413c42197433541842
|
7
|
+
data.tar.gz: 2f0f3d913be6828ac706e8b3805693118a4df5aaa462e0bc94ef0d88e2c254dff43ec8708cbdd059bbb5b2265340ba4c28ec15a968aafb5fdcbdceb6496950cc
|
data/lib/restforce/db/cleaner.rb
CHANGED
@@ -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
|
-
#
|
18
|
-
|
19
|
-
|
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
|
-
|
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
|
data/lib/restforce/db/version.rb
CHANGED
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.
|
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-
|
11
|
+
date: 2015-07-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|