restforce-db 3.4.0 → 3.5.0
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/accumulator.rb +1 -1
- data/lib/restforce/db/cleaner.rb +50 -7
- data/lib/restforce/db/instances/active_record.rb +13 -0
- data/lib/restforce/db/instances/base.rb +2 -0
- data/lib/restforce/db/synchronizer.rb +3 -4
- data/lib/restforce/db/version.rb +1 -1
- data/test/cassettes/Restforce_DB_Cleaner/_run/given_a_synchronized_Salesforce_record/when_the_record_does_not_meet_the_mapping_conditions/drops_the_synchronized_database_record.yml +76 -38
- data/test/lib/restforce/db/instances/active_record_test.rb +8 -0
- 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: a09f48ae39e990498c4277c8c538ddefa6299c64
|
4
|
+
data.tar.gz: f908032e59d2f1fc53177e396e6d3166f5643b6d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7264171810bbe421b589db829948ebf027487958ebdf4d2b29db5ce18842e0bb1c05c16b2d1567522e916f8d85041a892a507e23661f77b4bbb83d5eac66df9c
|
7
|
+
data.tar.gz: 4a19e74fb51bf354a950c9c012995bf3b2b65053d9a7636fe147141587d9b78d2c4be1600db7ab2aaa17e405fdf0b73aabb88eac6518c2613a1ffac77301d654
|
data/lib/restforce/db/cleaner.rb
CHANGED
@@ -7,11 +7,6 @@ module Restforce
|
|
7
7
|
# for a specific mapping.
|
8
8
|
class Cleaner < Task
|
9
9
|
|
10
|
-
# Salesforce can take a few minutes to register record deletion. This
|
11
|
-
# buffer gives us a window of time (in seconds) to look back and see
|
12
|
-
# records which may not have been visible in previous runs.
|
13
|
-
DELETION_READ_BUFFER = 3 * 60
|
14
|
-
|
15
10
|
# Public: Run the database culling loop for this mapping.
|
16
11
|
#
|
17
12
|
# Returns nothing.
|
@@ -29,6 +24,11 @@ module Restforce
|
|
29
24
|
deleted_salesforce_ids + invalid_salesforce_ids
|
30
25
|
end
|
31
26
|
|
27
|
+
# Salesforce can take a few minutes to register record deletion. This
|
28
|
+
# buffer gives us a window of time (in seconds) to look back and see
|
29
|
+
# records which may not have been visible in previous runs.
|
30
|
+
DELETION_READ_BUFFER = 3 * 60
|
31
|
+
|
32
32
|
# Internal: Get the IDs of records which have been removed from Salesforce
|
33
33
|
# for this mapping within the DELETION_BUFFER for this run.
|
34
34
|
#
|
@@ -36,7 +36,7 @@ module Restforce
|
|
36
36
|
def deleted_salesforce_ids
|
37
37
|
return [] unless @runner.after
|
38
38
|
|
39
|
-
response =
|
39
|
+
response = DB.client.get_deleted_between(
|
40
40
|
@mapping.salesforce_model,
|
41
41
|
@runner.after - DELETION_READ_BUFFER,
|
42
42
|
@runner.before,
|
@@ -62,7 +62,50 @@ module Restforce
|
|
62
62
|
valid_ids = valid_salesforce_ids
|
63
63
|
all_ids = all_salesforce_ids
|
64
64
|
|
65
|
-
all_ids - valid_ids
|
65
|
+
invalid_ids = all_ids - valid_ids
|
66
|
+
DB.logger.debug "(REPORTED INVALID) #{@mapping.salesforce_model} #{invalid_ids.inspect}" if invalid_ids.any?
|
67
|
+
|
68
|
+
invalid_ids = confirmed_invalid_salesforce_ids(invalid_ids)
|
69
|
+
DB.logger.debug "(CONFIRMED INVALID) #{@mapping.salesforce_model} #{invalid_ids.inspect}" if invalid_ids.any?
|
70
|
+
|
71
|
+
invalid_ids
|
72
|
+
end
|
73
|
+
|
74
|
+
# In order to ensure that we don't generate any SOQL queries which are too
|
75
|
+
# long to send across the wire to Salesforce, we need to batch IDs for our
|
76
|
+
# queries. For a conservative cap of 8,000 characters per GET query, at 27
|
77
|
+
# encoded characters per supplied ID (18 characters and 3 three-character
|
78
|
+
# entities), 250 IDs gives us a buffer of around 1250 spare characters to
|
79
|
+
# work with for the rest of the URL and query string.
|
80
|
+
#
|
81
|
+
# In practice, there should rarely/never be this many invalidated records
|
82
|
+
# at once during a single worker run.
|
83
|
+
MAXIMUM_IDS_PER_QUERY = 250
|
84
|
+
|
85
|
+
# Internal: Get the IDs of records which have been proposed as invalid and
|
86
|
+
# do not in fact appear in response to a time-insensitive query with the
|
87
|
+
# requisite conditions applied.
|
88
|
+
#
|
89
|
+
# NOTE: This double-check step is necessary to prevent an inaccurate
|
90
|
+
# Salesforce server clock from sending records back in time and forcing
|
91
|
+
# them to show up in a query running after-the-fact.
|
92
|
+
#
|
93
|
+
# proposed_invalid_ids - An Array of String Salesforce IDs to test against
|
94
|
+
# the Salesforce server.
|
95
|
+
#
|
96
|
+
# Returns an Array of IDs.
|
97
|
+
def confirmed_invalid_salesforce_ids(proposed_invalid_ids)
|
98
|
+
proposed_invalid_ids.each_slice(MAXIMUM_IDS_PER_QUERY).inject([]) do |invalid_ids, ids|
|
99
|
+
# Get a subset of the proposed list of IDs that corresponds to
|
100
|
+
# records which are still valid for any parallel mapping.
|
101
|
+
valid_ids = parallel_mappings.flat_map do |mapping|
|
102
|
+
mapping.salesforce_record_type.all(
|
103
|
+
conditions: "Id in ('#{ids.join("','")}')",
|
104
|
+
).map(&:id)
|
105
|
+
end
|
106
|
+
|
107
|
+
invalid_ids + (ids - valid_ids)
|
108
|
+
end
|
66
109
|
end
|
67
110
|
|
68
111
|
# Internal: Get the IDs of all recently-modified Salesforce records
|
@@ -27,6 +27,19 @@ module Restforce
|
|
27
27
|
"#{@record_type}::#{@record.id}"
|
28
28
|
end
|
29
29
|
|
30
|
+
# Public: Update the instance with the passed attributes.
|
31
|
+
#
|
32
|
+
# attributes - A Hash mapping attribute names to values.
|
33
|
+
#
|
34
|
+
# Returns self.
|
35
|
+
# Raises if the update fails for any reason.
|
36
|
+
def update!(attributes)
|
37
|
+
record.assign_attributes(attributes)
|
38
|
+
return self unless record.changed?
|
39
|
+
|
40
|
+
super attributes
|
41
|
+
end
|
42
|
+
|
30
43
|
# Public: Get the time of the last update to this record.
|
31
44
|
#
|
32
45
|
# Returns a Time-compatible object.
|
@@ -24,11 +24,10 @@ module Restforce
|
|
24
24
|
next unless salesforce_model == @mapping.salesforce_model
|
25
25
|
|
26
26
|
database_instance = @mapping.database_record_type.find(id)
|
27
|
-
|
27
|
+
next unless database_instance && up_to_date?(database_instance, accumulator)
|
28
28
|
|
29
|
-
|
30
|
-
next unless up_to_date?(
|
31
|
-
next unless up_to_date?(salesforce_instance, accumulator)
|
29
|
+
salesforce_instance = @mapping.salesforce_record_type.find(id)
|
30
|
+
next unless salesforce_instance && up_to_date?(salesforce_instance, accumulator)
|
32
31
|
|
33
32
|
update(database_instance, accumulator)
|
34
33
|
update(salesforce_instance, accumulator)
|
data/lib/restforce/db/version.rb
CHANGED
@@ -21,10 +21,10 @@ http_interactions:
|
|
21
21
|
message: OK
|
22
22
|
headers:
|
23
23
|
Date:
|
24
|
-
-
|
24
|
+
- Mon, 10 Aug 2015 23:12:14 GMT
|
25
25
|
Set-Cookie:
|
26
|
-
- BrowserId=
|
27
|
-
|
26
|
+
- BrowserId=Pg-Z5TJfRuCW_RRgxG0QFA;Path=/;Domain=.salesforce.com;Expires=Fri,
|
27
|
+
09-Oct-2015 23:12:14 GMT
|
28
28
|
Expires:
|
29
29
|
- Thu, 01 Jan 1970 00:00:00 GMT
|
30
30
|
Pragma:
|
@@ -37,9 +37,9 @@ http_interactions:
|
|
37
37
|
- chunked
|
38
38
|
body:
|
39
39
|
encoding: ASCII-8BIT
|
40
|
-
string: '{"id":"https://login.salesforce.com/id/00D1a000000H3O9EAK/0051a000000UGT8AAO","issued_at":"
|
40
|
+
string: '{"id":"https://login.salesforce.com/id/00D1a000000H3O9EAK/0051a000000UGT8AAO","issued_at":"1439248334477","token_type":"Bearer","instance_url":"https://<host>","signature":"e4cOS0HElwf+ao+4hWid5SJeb94IV5IF4TkST5zoKEE=","access_token":"00D1a000000H3O9!AQ4AQOZyg3C2dr3XwY4i4F6ogWYIBdVRdnC5SyknsMY0h.CF2FS2DMP0opJyeJ5DzTPkrmxhtvtezkCw3bLk3Rrrdr_znuim"}'
|
41
41
|
http_version:
|
42
|
-
recorded_at:
|
42
|
+
recorded_at: Mon, 10 Aug 2015 23:12:15 GMT
|
43
43
|
- request:
|
44
44
|
method: post
|
45
45
|
uri: https://<host>/services/data/<api_version>/sobjects/CustomObject__c
|
@@ -53,7 +53,7 @@ http_interactions:
|
|
53
53
|
Content-Type:
|
54
54
|
- application/json
|
55
55
|
Authorization:
|
56
|
-
- OAuth 00D1a000000H3O9!
|
56
|
+
- OAuth 00D1a000000H3O9!AQ4AQOZyg3C2dr3XwY4i4F6ogWYIBdVRdnC5SyknsMY0h.CF2FS2DMP0opJyeJ5DzTPkrmxhtvtezkCw3bLk3Rrrdr_znuim
|
57
57
|
Accept-Encoding:
|
58
58
|
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
59
59
|
Accept:
|
@@ -64,25 +64,25 @@ http_interactions:
|
|
64
64
|
message: Created
|
65
65
|
headers:
|
66
66
|
Date:
|
67
|
-
-
|
67
|
+
- Mon, 10 Aug 2015 23:12:14 GMT
|
68
68
|
Set-Cookie:
|
69
|
-
- BrowserId=
|
70
|
-
|
69
|
+
- BrowserId=DbP3fP37Ta6T3kwByVNhXg;Path=/;Domain=.salesforce.com;Expires=Fri,
|
70
|
+
09-Oct-2015 23:12:14 GMT
|
71
71
|
Expires:
|
72
72
|
- Thu, 01 Jan 1970 00:00:00 GMT
|
73
73
|
Sforce-Limit-Info:
|
74
74
|
- api-usage=1/15000
|
75
75
|
Location:
|
76
|
-
- "/services/data/<api_version>/sobjects/CustomObject__c/
|
76
|
+
- "/services/data/<api_version>/sobjects/CustomObject__c/a001a000004fPl6AAE"
|
77
77
|
Content-Type:
|
78
78
|
- application/json;charset=UTF-8
|
79
79
|
Transfer-Encoding:
|
80
80
|
- chunked
|
81
81
|
body:
|
82
82
|
encoding: ASCII-8BIT
|
83
|
-
string: '{"id":"
|
83
|
+
string: '{"id":"a001a000004fPl6AAE","success":true,"errors":[]}'
|
84
84
|
http_version:
|
85
|
-
recorded_at:
|
85
|
+
recorded_at: Mon, 10 Aug 2015 23:12:15 GMT
|
86
86
|
- request:
|
87
87
|
method: get
|
88
88
|
uri: https://<host>/services/data/<api_version>/sobjects/CustomObject__c/describe
|
@@ -93,7 +93,7 @@ http_interactions:
|
|
93
93
|
User-Agent:
|
94
94
|
- Faraday v0.9.1
|
95
95
|
Authorization:
|
96
|
-
- OAuth 00D1a000000H3O9!
|
96
|
+
- OAuth 00D1a000000H3O9!AQ4AQOZyg3C2dr3XwY4i4F6ogWYIBdVRdnC5SyknsMY0h.CF2FS2DMP0opJyeJ5DzTPkrmxhtvtezkCw3bLk3Rrrdr_znuim
|
97
97
|
Accept-Encoding:
|
98
98
|
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
99
99
|
Accept:
|
@@ -104,14 +104,14 @@ http_interactions:
|
|
104
104
|
message: OK
|
105
105
|
headers:
|
106
106
|
Date:
|
107
|
-
-
|
107
|
+
- Mon, 10 Aug 2015 23:12:15 GMT
|
108
108
|
Set-Cookie:
|
109
|
-
- BrowserId=
|
110
|
-
|
109
|
+
- BrowserId=bYS82CrPQfGm5hUwmYw_eA;Path=/;Domain=.salesforce.com;Expires=Fri,
|
110
|
+
09-Oct-2015 23:12:15 GMT
|
111
111
|
Expires:
|
112
112
|
- Thu, 01 Jan 1970 00:00:00 GMT
|
113
113
|
Sforce-Limit-Info:
|
114
|
-
- api-usage=
|
114
|
+
- api-usage=1/15000
|
115
115
|
Org.eclipse.jetty.server.include.etag:
|
116
116
|
- aa7ee96f
|
117
117
|
Last-Modified:
|
@@ -135,7 +135,7 @@ http_interactions:
|
|
135
135
|
Modstamp","length":0,"name":"SystemModstamp","nameField":false,"namePointing":false,"nillable":false,"permissionable":false,"picklistValues":[],"precision":0,"referenceTo":[],"relationshipName":null,"relationshipOrder":null,"restrictedDelete":false,"restrictedPicklist":false,"scale":0,"soapType":"xsd:dateTime","sortable":true,"type":"datetime","unique":false,"updateable":false,"writeRequiresMasterRead":false},{"autoNumber":false,"byteLength":765,"calculated":false,"calculatedFormula":null,"cascadeDelete":false,"caseSensitive":false,"controllerName":null,"createable":true,"custom":true,"defaultValue":null,"defaultValueFormula":null,"defaultedOnCreate":false,"dependentPicklist":false,"deprecatedAndHidden":false,"digits":0,"displayLocationInDecimal":false,"externalId":false,"filterable":true,"groupable":true,"htmlFormatted":false,"idLookup":false,"inlineHelpText":null,"label":"Example
|
136
136
|
Field","length":255,"name":"Example_Field__c","nameField":false,"namePointing":false,"nillable":true,"permissionable":true,"picklistValues":[],"precision":0,"referenceTo":[],"relationshipName":null,"relationshipOrder":null,"restrictedDelete":false,"restrictedPicklist":false,"scale":0,"soapType":"xsd:string","sortable":true,"type":"string","unique":false,"updateable":true,"writeRequiresMasterRead":false},{"autoNumber":false,"byteLength":18,"calculated":false,"calculatedFormula":null,"cascadeDelete":false,"caseSensitive":false,"controllerName":null,"createable":true,"custom":true,"defaultValue":null,"defaultValueFormula":null,"defaultedOnCreate":false,"dependentPicklist":false,"deprecatedAndHidden":false,"digits":0,"displayLocationInDecimal":false,"externalId":false,"filterable":true,"groupable":true,"htmlFormatted":false,"idLookup":false,"inlineHelpText":null,"label":"Friend","length":18,"name":"Friend__c","nameField":false,"namePointing":false,"nillable":true,"permissionable":true,"picklistValues":[],"precision":0,"referenceTo":["Contact"],"relationshipName":"Friend__r","relationshipOrder":null,"restrictedDelete":false,"restrictedPicklist":false,"scale":0,"soapType":"tns:ID","sortable":true,"type":"reference","unique":false,"updateable":true,"writeRequiresMasterRead":false},{"autoNumber":false,"byteLength":0,"calculated":false,"calculatedFormula":null,"cascadeDelete":false,"caseSensitive":false,"controllerName":null,"createable":true,"custom":true,"defaultValue":null,"defaultValueFormula":null,"defaultedOnCreate":true,"dependentPicklist":false,"deprecatedAndHidden":false,"digits":0,"displayLocationInDecimal":false,"externalId":false,"filterable":true,"groupable":true,"htmlFormatted":false,"idLookup":false,"inlineHelpText":null,"label":"Visible","length":0,"name":"Visible__c","nameField":false,"namePointing":false,"nillable":false,"permissionable":true,"picklistValues":[],"precision":0,"referenceTo":[],"relationshipName":null,"relationshipOrder":null,"restrictedDelete":false,"restrictedPicklist":false,"scale":0,"soapType":"xsd:boolean","sortable":true,"type":"boolean","unique":false,"updateable":true,"writeRequiresMasterRead":false},{"autoNumber":false,"byteLength":108,"calculated":false,"calculatedFormula":null,"cascadeDelete":false,"caseSensitive":false,"controllerName":null,"createable":true,"custom":true,"defaultValue":null,"defaultValueFormula":null,"defaultedOnCreate":false,"dependentPicklist":false,"deprecatedAndHidden":false,"digits":0,"displayLocationInDecimal":false,"externalId":true,"filterable":true,"groupable":true,"htmlFormatted":false,"idLookup":true,"inlineHelpText":null,"label":"SynchronizationID","length":36,"name":"SynchronizationId__c","nameField":false,"namePointing":false,"nillable":true,"permissionable":true,"picklistValues":[],"precision":0,"referenceTo":[],"relationshipName":null,"relationshipOrder":null,"restrictedDelete":false,"restrictedPicklist":false,"scale":0,"soapType":"xsd:string","sortable":true,"type":"string","unique":false,"updateable":true,"writeRequiresMasterRead":false}],"keyPrefix":"a00","label":"CustomObject","labelPlural":"CustomObjects","layoutable":true,"listviewable":null,"lookupLayoutable":null,"mergeable":false,"name":"CustomObject__c","queryable":true,"recordTypeInfos":[{"available":true,"defaultRecordTypeMapping":true,"name":"Master","recordTypeId":"012000000000000AAA","urls":{"layout":"/services/data/<api_version>/sobjects/CustomObject__c/describe/layouts/012000000000000AAA"}}],"replicateable":true,"retrieveable":true,"searchLayoutable":true,"searchable":true,"triggerable":true,"undeletable":true,"updateable":true,"urls":{"uiEditTemplate":"https://<host>/{ID}/e","sobject":"/services/data/<api_version>/sobjects/CustomObject__c","quickActions":"/services/data/<api_version>/sobjects/CustomObject__c/quickActions","uiDetailTemplate":"https://<host>/{ID}","describe":"/services/data/<api_version>/sobjects/CustomObject__c/describe","rowTemplate":"/services/data/<api_version>/sobjects/CustomObject__c/{ID}","layouts":"/services/data/<api_version>/sobjects/CustomObject__c/describe/layouts","compactLayouts":"/services/data/<api_version>/sobjects/CustomObject__c/describe/compactLayouts","uiNewRecord":"https://<host>/a00/e"}}'
|
137
137
|
http_version:
|
138
|
-
recorded_at:
|
138
|
+
recorded_at: Mon, 10 Aug 2015 23:12:16 GMT
|
139
139
|
- request:
|
140
140
|
method: get
|
141
141
|
uri: https://<host>/services/data/<api_version>/query?q=select%20Id,%20SynchronizationId__c,%20SystemModstamp,%20LastModifiedById,%20Name,%20Example_Field__c%20from%20CustomObject__c%20where%20Name%20!=%20%27Are%20you%20going%20to%20Scarborough%20Fair?%27
|
@@ -146,7 +146,7 @@ http_interactions:
|
|
146
146
|
User-Agent:
|
147
147
|
- Faraday v0.9.1
|
148
148
|
Authorization:
|
149
|
-
- OAuth 00D1a000000H3O9!
|
149
|
+
- OAuth 00D1a000000H3O9!AQ4AQOZyg3C2dr3XwY4i4F6ogWYIBdVRdnC5SyknsMY0h.CF2FS2DMP0opJyeJ5DzTPkrmxhtvtezkCw3bLk3Rrrdr_znuim
|
150
150
|
Accept-Encoding:
|
151
151
|
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
152
152
|
Accept:
|
@@ -157,14 +157,14 @@ http_interactions:
|
|
157
157
|
message: OK
|
158
158
|
headers:
|
159
159
|
Date:
|
160
|
-
-
|
160
|
+
- Mon, 10 Aug 2015 23:12:16 GMT
|
161
161
|
Set-Cookie:
|
162
|
-
- BrowserId=
|
163
|
-
|
162
|
+
- BrowserId=calRGewTRle9zQ4W8ms3ig;Path=/;Domain=.salesforce.com;Expires=Fri,
|
163
|
+
09-Oct-2015 23:12:16 GMT
|
164
164
|
Expires:
|
165
165
|
- Thu, 01 Jan 1970 00:00:00 GMT
|
166
166
|
Sforce-Limit-Info:
|
167
|
-
- api-usage=
|
167
|
+
- api-usage=1/15000
|
168
168
|
Content-Type:
|
169
169
|
- application/json;charset=UTF-8
|
170
170
|
Transfer-Encoding:
|
@@ -173,7 +173,7 @@ http_interactions:
|
|
173
173
|
encoding: ASCII-8BIT
|
174
174
|
string: '{"totalSize":0,"done":true,"records":[]}'
|
175
175
|
http_version:
|
176
|
-
recorded_at:
|
176
|
+
recorded_at: Mon, 10 Aug 2015 23:12:16 GMT
|
177
177
|
- request:
|
178
178
|
method: get
|
179
179
|
uri: https://<host>/services/data/<api_version>/query?q=select%20Id,%20SynchronizationId__c,%20SystemModstamp,%20LastModifiedById,%20Name,%20Example_Field__c%20from%20CustomObject__c
|
@@ -184,7 +184,7 @@ http_interactions:
|
|
184
184
|
User-Agent:
|
185
185
|
- Faraday v0.9.1
|
186
186
|
Authorization:
|
187
|
-
- OAuth 00D1a000000H3O9!
|
187
|
+
- OAuth 00D1a000000H3O9!AQ4AQOZyg3C2dr3XwY4i4F6ogWYIBdVRdnC5SyknsMY0h.CF2FS2DMP0opJyeJ5DzTPkrmxhtvtezkCw3bLk3Rrrdr_znuim
|
188
188
|
Accept-Encoding:
|
189
189
|
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
190
190
|
Accept:
|
@@ -195,28 +195,66 @@ http_interactions:
|
|
195
195
|
message: OK
|
196
196
|
headers:
|
197
197
|
Date:
|
198
|
-
-
|
198
|
+
- Mon, 10 Aug 2015 23:12:16 GMT
|
199
199
|
Set-Cookie:
|
200
|
-
- BrowserId=
|
201
|
-
|
200
|
+
- BrowserId=AH6hZ-SPQEWVReahwb188g;Path=/;Domain=.salesforce.com;Expires=Fri,
|
201
|
+
09-Oct-2015 23:12:16 GMT
|
202
202
|
Expires:
|
203
203
|
- Thu, 01 Jan 1970 00:00:00 GMT
|
204
204
|
Sforce-Limit-Info:
|
205
|
-
- api-usage=
|
205
|
+
- api-usage=1/15000
|
206
206
|
Content-Type:
|
207
207
|
- application/json;charset=UTF-8
|
208
208
|
Transfer-Encoding:
|
209
209
|
- chunked
|
210
210
|
body:
|
211
211
|
encoding: ASCII-8BIT
|
212
|
-
string: '{"totalSize":1,"done":true,"records":[{"attributes":{"type":"CustomObject__c","url":"/services/data/<api_version>/sobjects/CustomObject__c/
|
212
|
+
string: '{"totalSize":1,"done":true,"records":[{"attributes":{"type":"CustomObject__c","url":"/services/data/<api_version>/sobjects/CustomObject__c/a001a000004fPl6AAE"},"Id":"a001a000004fPl6AAE","SynchronizationId__c":null,"SystemModstamp":"2015-08-10T23:12:14.000+0000","LastModifiedById":"0051a000000UGT8AAO","Name":"Are
|
213
213
|
you going to Scarborough Fair?","Example_Field__c":"Parsley, Sage, Rosemary,
|
214
214
|
and Thyme."}]}'
|
215
215
|
http_version:
|
216
|
-
recorded_at:
|
216
|
+
recorded_at: Mon, 10 Aug 2015 23:12:16 GMT
|
217
|
+
- request:
|
218
|
+
method: get
|
219
|
+
uri: https://<host>/services/data/<api_version>/query?q=select%20Id,%20SynchronizationId__c,%20SystemModstamp,%20LastModifiedById,%20Name,%20Example_Field__c%20from%20CustomObject__c%20where%20Id%20in%20(%27a001a000004fPl6AAE%27)%20and%20Name%20!=%20%27Are%20you%20going%20to%20Scarborough%20Fair?%27
|
220
|
+
body:
|
221
|
+
encoding: US-ASCII
|
222
|
+
string: ''
|
223
|
+
headers:
|
224
|
+
User-Agent:
|
225
|
+
- Faraday v0.9.1
|
226
|
+
Authorization:
|
227
|
+
- OAuth 00D1a000000H3O9!AQ4AQOZyg3C2dr3XwY4i4F6ogWYIBdVRdnC5SyknsMY0h.CF2FS2DMP0opJyeJ5DzTPkrmxhtvtezkCw3bLk3Rrrdr_znuim
|
228
|
+
Accept-Encoding:
|
229
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
230
|
+
Accept:
|
231
|
+
- "*/*"
|
232
|
+
response:
|
233
|
+
status:
|
234
|
+
code: 200
|
235
|
+
message: OK
|
236
|
+
headers:
|
237
|
+
Date:
|
238
|
+
- Mon, 10 Aug 2015 23:12:16 GMT
|
239
|
+
Set-Cookie:
|
240
|
+
- BrowserId=GJp8r-GMS9-JZT24SfJ-Uw;Path=/;Domain=.salesforce.com;Expires=Fri,
|
241
|
+
09-Oct-2015 23:12:16 GMT
|
242
|
+
Expires:
|
243
|
+
- Thu, 01 Jan 1970 00:00:00 GMT
|
244
|
+
Sforce-Limit-Info:
|
245
|
+
- api-usage=1/15000
|
246
|
+
Content-Type:
|
247
|
+
- application/json;charset=UTF-8
|
248
|
+
Transfer-Encoding:
|
249
|
+
- chunked
|
250
|
+
body:
|
251
|
+
encoding: ASCII-8BIT
|
252
|
+
string: '{"totalSize":0,"done":true,"records":[]}'
|
253
|
+
http_version:
|
254
|
+
recorded_at: Mon, 10 Aug 2015 23:12:17 GMT
|
217
255
|
- request:
|
218
256
|
method: delete
|
219
|
-
uri: https://<host>/services/data/<api_version>/sobjects/CustomObject__c/
|
257
|
+
uri: https://<host>/services/data/<api_version>/sobjects/CustomObject__c/a001a000004fPl6AAE
|
220
258
|
body:
|
221
259
|
encoding: US-ASCII
|
222
260
|
string: ''
|
@@ -224,7 +262,7 @@ http_interactions:
|
|
224
262
|
User-Agent:
|
225
263
|
- Faraday v0.9.1
|
226
264
|
Authorization:
|
227
|
-
- OAuth 00D1a000000H3O9!
|
265
|
+
- OAuth 00D1a000000H3O9!AQ4AQOZyg3C2dr3XwY4i4F6ogWYIBdVRdnC5SyknsMY0h.CF2FS2DMP0opJyeJ5DzTPkrmxhtvtezkCw3bLk3Rrrdr_znuim
|
228
266
|
Accept-Encoding:
|
229
267
|
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
230
268
|
Accept:
|
@@ -235,17 +273,17 @@ http_interactions:
|
|
235
273
|
message: No Content
|
236
274
|
headers:
|
237
275
|
Date:
|
238
|
-
-
|
276
|
+
- Mon, 10 Aug 2015 23:12:16 GMT
|
239
277
|
Set-Cookie:
|
240
|
-
- BrowserId=
|
241
|
-
|
278
|
+
- BrowserId=FT_S2vowR0y2vled5dSwlA;Path=/;Domain=.salesforce.com;Expires=Fri,
|
279
|
+
09-Oct-2015 23:12:16 GMT
|
242
280
|
Expires:
|
243
281
|
- Thu, 01 Jan 1970 00:00:00 GMT
|
244
282
|
Sforce-Limit-Info:
|
245
|
-
- api-usage=
|
283
|
+
- api-usage=1/15000
|
246
284
|
body:
|
247
285
|
encoding: UTF-8
|
248
286
|
string: ''
|
249
287
|
http_version:
|
250
|
-
recorded_at:
|
288
|
+
recorded_at: Mon, 10 Aug 2015 23:12:18 GMT
|
251
289
|
recorded_with: VCR 2.9.3
|
@@ -56,6 +56,14 @@ describe Restforce::DB::Instances::ActiveRecord do
|
|
56
56
|
it "bumps the record's synchronized_at timestamp" do
|
57
57
|
expect(record.reload.synchronized_at).to_not_be_nil
|
58
58
|
end
|
59
|
+
|
60
|
+
describe "when the passed attributes match the current values" do
|
61
|
+
let(:text) { record.example }
|
62
|
+
|
63
|
+
it "does not bump the record's synchronized_at timestamp" do
|
64
|
+
expect(record.reload.synchronized_at).to_be_nil
|
65
|
+
end
|
66
|
+
end
|
59
67
|
end
|
60
68
|
|
61
69
|
describe "#updated_internally?" do
|
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.
|
4
|
+
version: 3.5.0
|
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-08-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|