restforce-db 1.0.4 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (45) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +38 -22
  3. data/lib/restforce/db/associations/base.rb +152 -0
  4. data/lib/restforce/db/associations/belongs_to.rb +70 -0
  5. data/lib/restforce/db/associations/foreign_key.rb +80 -0
  6. data/lib/restforce/db/associations/has_many.rb +37 -0
  7. data/lib/restforce/db/associations/has_one.rb +33 -0
  8. data/lib/restforce/db/dsl.rb +25 -13
  9. data/lib/restforce/db/mapping.rb +2 -3
  10. data/lib/restforce/db/record_types/active_record.rb +3 -8
  11. data/lib/restforce/db/record_types/salesforce.rb +23 -8
  12. data/lib/restforce/db/strategies/associated.rb +58 -0
  13. data/lib/restforce/db/version.rb +1 -1
  14. data/lib/restforce/db.rb +6 -1
  15. data/restforce-db.gemspec +0 -1
  16. data/test/cassettes/Restforce_DB_Associations_BelongsTo/with_an_inverse_mapping/_build/returns_an_associated_record_populated_with_the_Salesforce_attributes.yml +271 -0
  17. data/test/cassettes/Restforce_DB_Associations_BelongsTo/with_an_inverse_mapping/_synced_for_/when_a_matching_associated_record_has_been_synchronized/returns_true.yml +271 -0
  18. data/test/cassettes/Restforce_DB_Associations_BelongsTo/with_an_inverse_mapping/_synced_for_/when_no_matching_associated_record_has_been_synchronized/returns_false.yml +271 -0
  19. data/test/cassettes/Restforce_DB_Associations_HasMany/with_an_inverse_mapping/_build/builds_a_number_of_associated_records_from_the_data_in_Salesforce.yml +439 -0
  20. data/test/cassettes/Restforce_DB_Associations_HasMany/with_an_inverse_mapping/_synced_for_/when_a_matching_associated_record_has_been_synchronized/returns_true.yml +439 -0
  21. data/test/cassettes/Restforce_DB_Associations_HasMany/with_an_inverse_mapping/_synced_for_/when_no_matching_associated_record_has_been_synchronized/returns_false.yml +196 -0
  22. data/test/cassettes/Restforce_DB_Associations_HasOne/with_an_inverse_mapping/_build/returns_an_associated_record_populated_with_the_Salesforce_attributes.yml +271 -0
  23. data/test/cassettes/Restforce_DB_Associations_HasOne/with_an_inverse_mapping/_synced_for_/when_a_matching_associated_record_has_been_synchronized/returns_true.yml +271 -0
  24. data/test/cassettes/Restforce_DB_Associations_HasOne/with_an_inverse_mapping/_synced_for_/when_no_matching_associated_record_has_been_synchronized/returns_false.yml +271 -0
  25. data/test/cassettes/Restforce_DB_Strategies_Associated/_build_/given_an_inverse_mapping/with_a_synchronized_association_record/wants_to_build_a_new_record.yml +275 -0
  26. data/test/cassettes/Restforce_DB_Strategies_Associated/_build_/given_an_inverse_mapping/with_an_existing_database_record/does_not_want_to_build_a_new_record.yml +237 -0
  27. data/test/cassettes/Restforce_DB_Strategies_Associated/_build_/given_an_inverse_mapping/with_no_synchronized_association_record/does_not_want_to_build_a_new_record.yml +275 -0
  28. data/test/lib/restforce/db/associations/belongs_to_test.rb +82 -0
  29. data/test/lib/restforce/db/associations/has_many_test.rb +96 -0
  30. data/test/lib/restforce/db/associations/has_one_test.rb +80 -0
  31. data/test/lib/restforce/db/dsl_test.rb +22 -3
  32. data/test/lib/restforce/db/mapping_test.rb +10 -8
  33. data/test/lib/restforce/db/record_types/active_record_test.rb +12 -5
  34. data/test/lib/restforce/db/runner_test.rb +2 -3
  35. data/test/lib/restforce/db/strategies/always_test.rb +2 -2
  36. data/test/lib/restforce/db/strategies/associated_test.rb +78 -0
  37. data/test/lib/restforce/db/strategies/passive_test.rb +1 -1
  38. data/test/lib/restforce/db/tracker_test.rb +0 -2
  39. data/test/support/active_record.rb +25 -2
  40. data/test/support/salesforce.rb +1 -1
  41. data/test/support/utilities.rb +5 -7
  42. data/test/test_helper.rb +0 -1
  43. metadata +24 -18
  44. data/lib/restforce/db/associations/active_record.rb +0 -68
  45. data/test/lib/restforce/db/associations/active_record_test.rb +0 -43
@@ -0,0 +1,271 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://<host>/services/oauth2/token
6
+ body:
7
+ encoding: US-ASCII
8
+ string: grant_type=password&client_id=<client_id>&client_secret=<client_secret>&username=<username>&password=<password><security_token>
9
+ headers:
10
+ User-Agent:
11
+ - Faraday v0.9.1
12
+ Content-Type:
13
+ - application/x-www-form-urlencoded
14
+ Accept-Encoding:
15
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
16
+ Accept:
17
+ - "*/*"
18
+ response:
19
+ status:
20
+ code: 200
21
+ message: OK
22
+ headers:
23
+ Date:
24
+ - Sat, 11 Apr 2015 01:23:12 GMT
25
+ Set-Cookie:
26
+ - BrowserId=BTKOVPdmQySASfnudICz-w;Path=/;Domain=.salesforce.com;Expires=Wed,
27
+ 10-Jun-2015 01:23:12 GMT
28
+ Expires:
29
+ - Thu, 01 Jan 1970 00:00:00 GMT
30
+ Pragma:
31
+ - no-cache
32
+ Cache-Control:
33
+ - no-cache, no-store
34
+ Content-Type:
35
+ - application/json;charset=UTF-8
36
+ Transfer-Encoding:
37
+ - chunked
38
+ body:
39
+ encoding: ASCII-8BIT
40
+ string: '{"id":"https://login.salesforce.com/id/00D1a000000H3O9EAK/0051a000000UGT8AAO","issued_at":"1428715392140","token_type":"Bearer","instance_url":"https://<host>","signature":"bcg+FhBqe0ZyHpYd43tkTmXlDCi8iyF0A98BQ01cUaY=","access_token":"00D1a000000H3O9!AQ4AQKzh13pKuR2SlS.Cq04BnD.sliu.0jLuP2qUQvVfZBc5RaiRknImPjcZu5w_dvIzyN831OnqnR.o9XKdgX14n3l6dNnj"}'
41
+ http_version:
42
+ recorded_at: Sat, 11 Apr 2015 01:23:12 GMT
43
+ - request:
44
+ method: post
45
+ uri: https://<host>/services/data/v26.0/sobjects/Contact
46
+ body:
47
+ encoding: UTF-8
48
+ string: '{"Email":"somebody@example.com","LastName":"Somebody"}'
49
+ headers:
50
+ User-Agent:
51
+ - Faraday v0.9.1
52
+ Content-Type:
53
+ - application/json
54
+ Authorization:
55
+ - OAuth 00D1a000000H3O9!AQ4AQKzh13pKuR2SlS.Cq04BnD.sliu.0jLuP2qUQvVfZBc5RaiRknImPjcZu5w_dvIzyN831OnqnR.o9XKdgX14n3l6dNnj
56
+ Accept-Encoding:
57
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
58
+ Accept:
59
+ - "*/*"
60
+ response:
61
+ status:
62
+ code: 201
63
+ message: Created
64
+ headers:
65
+ Date:
66
+ - Sat, 11 Apr 2015 01:23:14 GMT
67
+ Set-Cookie:
68
+ - BrowserId=nW4xVu5zS8OVsvmDqd8qyQ;Path=/;Domain=.salesforce.com;Expires=Wed,
69
+ 10-Jun-2015 01:23:14 GMT
70
+ Expires:
71
+ - Thu, 01 Jan 1970 00:00:00 GMT
72
+ Sforce-Limit-Info:
73
+ - api-usage=100/15000
74
+ Location:
75
+ - "/services/data/v26.0/sobjects/Contact/0031a000001yZN2AAM"
76
+ Content-Type:
77
+ - application/json;charset=UTF-8
78
+ Transfer-Encoding:
79
+ - chunked
80
+ body:
81
+ encoding: ASCII-8BIT
82
+ string: '{"id":"0031a000001yZN2AAM","success":true,"errors":[]}'
83
+ http_version:
84
+ recorded_at: Sat, 11 Apr 2015 01:23:14 GMT
85
+ - request:
86
+ method: post
87
+ uri: https://<host>/services/data/v26.0/sobjects/CustomObject__c
88
+ body:
89
+ encoding: UTF-8
90
+ string: '{"Friend__c":"0031a000001yZN2AAM"}'
91
+ headers:
92
+ User-Agent:
93
+ - Faraday v0.9.1
94
+ Content-Type:
95
+ - application/json
96
+ Authorization:
97
+ - OAuth 00D1a000000H3O9!AQ4AQKzh13pKuR2SlS.Cq04BnD.sliu.0jLuP2qUQvVfZBc5RaiRknImPjcZu5w_dvIzyN831OnqnR.o9XKdgX14n3l6dNnj
98
+ Accept-Encoding:
99
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
100
+ Accept:
101
+ - "*/*"
102
+ response:
103
+ status:
104
+ code: 201
105
+ message: Created
106
+ headers:
107
+ Date:
108
+ - Sat, 11 Apr 2015 01:23:15 GMT
109
+ Set-Cookie:
110
+ - BrowserId=4T4jjRFBSP6daf4Qk0hLZQ;Path=/;Domain=.salesforce.com;Expires=Wed,
111
+ 10-Jun-2015 01:23:15 GMT
112
+ Expires:
113
+ - Thu, 01 Jan 1970 00:00:00 GMT
114
+ Sforce-Limit-Info:
115
+ - api-usage=100/15000
116
+ Location:
117
+ - "/services/data/v26.0/sobjects/CustomObject__c/a001a000001LXgKAAW"
118
+ Content-Type:
119
+ - application/json;charset=UTF-8
120
+ Transfer-Encoding:
121
+ - chunked
122
+ body:
123
+ encoding: ASCII-8BIT
124
+ string: '{"id":"a001a000001LXgKAAW","success":true,"errors":[]}'
125
+ http_version:
126
+ recorded_at: Sat, 11 Apr 2015 01:23:16 GMT
127
+ - request:
128
+ method: get
129
+ uri: https://<host>/services/data/v26.0/query?q=select%20Id,%20SystemModstamp,%20Name,%20Example_Field__c,%20Friend__c%20from%20CustomObject__c%20where%20Id%20=%20%27a001a000001LXgKAAW%27
130
+ body:
131
+ encoding: US-ASCII
132
+ string: ''
133
+ headers:
134
+ User-Agent:
135
+ - Faraday v0.9.1
136
+ Authorization:
137
+ - OAuth 00D1a000000H3O9!AQ4AQKzh13pKuR2SlS.Cq04BnD.sliu.0jLuP2qUQvVfZBc5RaiRknImPjcZu5w_dvIzyN831OnqnR.o9XKdgX14n3l6dNnj
138
+ Accept-Encoding:
139
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
140
+ Accept:
141
+ - "*/*"
142
+ response:
143
+ status:
144
+ code: 200
145
+ message: OK
146
+ headers:
147
+ Date:
148
+ - Sat, 11 Apr 2015 01:23:16 GMT
149
+ Set-Cookie:
150
+ - BrowserId=tLFbGtRnSt-8k-hKMrDtog;Path=/;Domain=.salesforce.com;Expires=Wed,
151
+ 10-Jun-2015 01:23:16 GMT
152
+ Expires:
153
+ - Thu, 01 Jan 1970 00:00:00 GMT
154
+ Sforce-Limit-Info:
155
+ - api-usage=100/15000
156
+ Content-Type:
157
+ - application/json;charset=UTF-8
158
+ Transfer-Encoding:
159
+ - chunked
160
+ body:
161
+ encoding: ASCII-8BIT
162
+ string: '{"totalSize":1,"done":true,"records":[{"attributes":{"type":"CustomObject__c","url":"/services/data/v26.0/sobjects/CustomObject__c/a001a000001LXgKAAW"},"Id":"a001a000001LXgKAAW","SystemModstamp":"2015-04-11T01:23:15.000+0000","Name":"a001a000001LXgK","Example_Field__c":null,"Friend__c":"0031a000001yZN2AAM"}]}'
163
+ http_version:
164
+ recorded_at: Sat, 11 Apr 2015 01:23:17 GMT
165
+ - request:
166
+ method: get
167
+ uri: https://<host>/services/data/v26.0/query?q=select%20Id,%20SystemModstamp,%20Name,%20Example_Field__c,%20Friend__c%20from%20CustomObject__c%20where%20Id%20=%20%27a001a000001LXgKAAW%27
168
+ body:
169
+ encoding: US-ASCII
170
+ string: ''
171
+ headers:
172
+ User-Agent:
173
+ - Faraday v0.9.1
174
+ Authorization:
175
+ - OAuth 00D1a000000H3O9!AQ4AQKzh13pKuR2SlS.Cq04BnD.sliu.0jLuP2qUQvVfZBc5RaiRknImPjcZu5w_dvIzyN831OnqnR.o9XKdgX14n3l6dNnj
176
+ Accept-Encoding:
177
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
178
+ Accept:
179
+ - "*/*"
180
+ response:
181
+ status:
182
+ code: 200
183
+ message: OK
184
+ headers:
185
+ Date:
186
+ - Sat, 11 Apr 2015 01:23:17 GMT
187
+ Set-Cookie:
188
+ - BrowserId=32_mDTRRTD2DMwZ58IBL3w;Path=/;Domain=.salesforce.com;Expires=Wed,
189
+ 10-Jun-2015 01:23:17 GMT
190
+ Expires:
191
+ - Thu, 01 Jan 1970 00:00:00 GMT
192
+ Sforce-Limit-Info:
193
+ - api-usage=100/15000
194
+ Content-Type:
195
+ - application/json;charset=UTF-8
196
+ Transfer-Encoding:
197
+ - chunked
198
+ body:
199
+ encoding: ASCII-8BIT
200
+ string: '{"totalSize":1,"done":true,"records":[{"attributes":{"type":"CustomObject__c","url":"/services/data/v26.0/sobjects/CustomObject__c/a001a000001LXgKAAW"},"Id":"a001a000001LXgKAAW","SystemModstamp":"2015-04-11T01:23:15.000+0000","Name":"a001a000001LXgK","Example_Field__c":null,"Friend__c":"0031a000001yZN2AAM"}]}'
201
+ http_version:
202
+ recorded_at: Sat, 11 Apr 2015 01:23:18 GMT
203
+ - request:
204
+ method: delete
205
+ uri: https://<host>/services/data/v26.0/sobjects/Contact/0031a000001yZN2AAM
206
+ body:
207
+ encoding: US-ASCII
208
+ string: ''
209
+ headers:
210
+ User-Agent:
211
+ - Faraday v0.9.1
212
+ Authorization:
213
+ - OAuth 00D1a000000H3O9!AQ4AQKzh13pKuR2SlS.Cq04BnD.sliu.0jLuP2qUQvVfZBc5RaiRknImPjcZu5w_dvIzyN831OnqnR.o9XKdgX14n3l6dNnj
214
+ Accept-Encoding:
215
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
216
+ Accept:
217
+ - "*/*"
218
+ response:
219
+ status:
220
+ code: 204
221
+ message: No Content
222
+ headers:
223
+ Date:
224
+ - Sat, 11 Apr 2015 01:23:18 GMT
225
+ Set-Cookie:
226
+ - BrowserId=bM2066kCTMCnkZZZ4YvewA;Path=/;Domain=.salesforce.com;Expires=Wed,
227
+ 10-Jun-2015 01:23:18 GMT
228
+ Expires:
229
+ - Thu, 01 Jan 1970 00:00:00 GMT
230
+ Sforce-Limit-Info:
231
+ - api-usage=100/15000
232
+ body:
233
+ encoding: UTF-8
234
+ string: ''
235
+ http_version:
236
+ recorded_at: Sat, 11 Apr 2015 01:23:19 GMT
237
+ - request:
238
+ method: delete
239
+ uri: https://<host>/services/data/v26.0/sobjects/CustomObject__c/a001a000001LXgKAAW
240
+ body:
241
+ encoding: US-ASCII
242
+ string: ''
243
+ headers:
244
+ User-Agent:
245
+ - Faraday v0.9.1
246
+ Authorization:
247
+ - OAuth 00D1a000000H3O9!AQ4AQKzh13pKuR2SlS.Cq04BnD.sliu.0jLuP2qUQvVfZBc5RaiRknImPjcZu5w_dvIzyN831OnqnR.o9XKdgX14n3l6dNnj
248
+ Accept-Encoding:
249
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
250
+ Accept:
251
+ - "*/*"
252
+ response:
253
+ status:
254
+ code: 204
255
+ message: No Content
256
+ headers:
257
+ Date:
258
+ - Sat, 11 Apr 2015 01:23:20 GMT
259
+ Set-Cookie:
260
+ - BrowserId=45Q39T1eTzmkDnRLr04BPg;Path=/;Domain=.salesforce.com;Expires=Wed,
261
+ 10-Jun-2015 01:23:20 GMT
262
+ Expires:
263
+ - Thu, 01 Jan 1970 00:00:00 GMT
264
+ Sforce-Limit-Info:
265
+ - api-usage=100/15000
266
+ body:
267
+ encoding: UTF-8
268
+ string: ''
269
+ http_version:
270
+ recorded_at: Sat, 11 Apr 2015 01:23:20 GMT
271
+ recorded_with: VCR 2.9.3
@@ -0,0 +1,439 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://<host>/services/oauth2/token
6
+ body:
7
+ encoding: US-ASCII
8
+ string: grant_type=password&client_id=<client_id>&client_secret=<client_secret>&username=<username>&password=<password><security_token>
9
+ headers:
10
+ User-Agent:
11
+ - Faraday v0.9.1
12
+ Content-Type:
13
+ - application/x-www-form-urlencoded
14
+ Accept-Encoding:
15
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
16
+ Accept:
17
+ - "*/*"
18
+ response:
19
+ status:
20
+ code: 200
21
+ message: OK
22
+ headers:
23
+ Date:
24
+ - Fri, 10 Apr 2015 02:57:52 GMT
25
+ Set-Cookie:
26
+ - BrowserId=SjnTW7F7RkKsIjaFmUtNzw;Path=/;Domain=.salesforce.com;Expires=Tue,
27
+ 09-Jun-2015 02:57:52 GMT
28
+ Expires:
29
+ - Thu, 01 Jan 1970 00:00:00 GMT
30
+ Pragma:
31
+ - no-cache
32
+ Cache-Control:
33
+ - no-cache, no-store
34
+ Content-Type:
35
+ - application/json;charset=UTF-8
36
+ Transfer-Encoding:
37
+ - chunked
38
+ body:
39
+ encoding: ASCII-8BIT
40
+ string: '{"id":"https://login.salesforce.com/id/00D1a000000H3O9EAK/0051a000000UGT8AAO","issued_at":"1428634672541","token_type":"Bearer","instance_url":"https://<host>","signature":"+Yw0d+DUcrlkXfNTN9OldvMmsaQIzIfxRVOXzMBfzrA=","access_token":"00D1a000000H3O9!AQ4AQNe4R8V.LO2wVndhS1VuuxNtdXS1JCvyNPnzJvH6QSXO9uYDDviw_E1.9iDm2CAsI8PipNylFdpNxUnQrofmMfc7RNsW"}'
41
+ http_version:
42
+ recorded_at: Fri, 10 Apr 2015 02:57:52 GMT
43
+ - request:
44
+ method: post
45
+ uri: https://<host>/services/data/v26.0/sobjects/CustomObject__c
46
+ body:
47
+ encoding: UTF-8
48
+ string: '{"Name":"Sample object"}'
49
+ headers:
50
+ User-Agent:
51
+ - Faraday v0.9.1
52
+ Content-Type:
53
+ - application/json
54
+ Authorization:
55
+ - OAuth 00D1a000000H3O9!AQ4AQNe4R8V.LO2wVndhS1VuuxNtdXS1JCvyNPnzJvH6QSXO9uYDDviw_E1.9iDm2CAsI8PipNylFdpNxUnQrofmMfc7RNsW
56
+ Accept-Encoding:
57
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
58
+ Accept:
59
+ - "*/*"
60
+ response:
61
+ status:
62
+ code: 201
63
+ message: Created
64
+ headers:
65
+ Date:
66
+ - Fri, 10 Apr 2015 02:57:54 GMT
67
+ Set-Cookie:
68
+ - BrowserId=XSyg9Tt9SFqz-UswEKwn_Q;Path=/;Domain=.salesforce.com;Expires=Tue,
69
+ 09-Jun-2015 02:57:54 GMT
70
+ Expires:
71
+ - Thu, 01 Jan 1970 00:00:00 GMT
72
+ Sforce-Limit-Info:
73
+ - api-usage=48/15000
74
+ Location:
75
+ - "/services/data/v26.0/sobjects/CustomObject__c/a001a000001LS2dAAG"
76
+ Content-Type:
77
+ - application/json;charset=UTF-8
78
+ Transfer-Encoding:
79
+ - chunked
80
+ body:
81
+ encoding: ASCII-8BIT
82
+ string: '{"id":"a001a000001LS2dAAG","success":true,"errors":[]}'
83
+ http_version:
84
+ recorded_at: Fri, 10 Apr 2015 02:57:54 GMT
85
+ - request:
86
+ method: post
87
+ uri: https://<host>/services/data/v26.0/sobjects/CustomObjectDetail__c
88
+ body:
89
+ encoding: UTF-8
90
+ string: '{"Name":"First Detail","CustomObject__c":"a001a000001LS2dAAG"}'
91
+ headers:
92
+ User-Agent:
93
+ - Faraday v0.9.1
94
+ Content-Type:
95
+ - application/json
96
+ Authorization:
97
+ - OAuth 00D1a000000H3O9!AQ4AQNe4R8V.LO2wVndhS1VuuxNtdXS1JCvyNPnzJvH6QSXO9uYDDviw_E1.9iDm2CAsI8PipNylFdpNxUnQrofmMfc7RNsW
98
+ Accept-Encoding:
99
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
100
+ Accept:
101
+ - "*/*"
102
+ response:
103
+ status:
104
+ code: 201
105
+ message: Created
106
+ headers:
107
+ Date:
108
+ - Fri, 10 Apr 2015 02:57:55 GMT
109
+ Set-Cookie:
110
+ - BrowserId=By4dF0JzTXCXJChaCwVarQ;Path=/;Domain=.salesforce.com;Expires=Tue,
111
+ 09-Jun-2015 02:57:55 GMT
112
+ Expires:
113
+ - Thu, 01 Jan 1970 00:00:00 GMT
114
+ Sforce-Limit-Info:
115
+ - api-usage=48/15000
116
+ Location:
117
+ - "/services/data/v26.0/sobjects/CustomObjectDetail__c/a011a000000gvbNAAQ"
118
+ Content-Type:
119
+ - application/json;charset=UTF-8
120
+ Transfer-Encoding:
121
+ - chunked
122
+ body:
123
+ encoding: ASCII-8BIT
124
+ string: '{"id":"a011a000000gvbNAAQ","success":true,"errors":[]}'
125
+ http_version:
126
+ recorded_at: Fri, 10 Apr 2015 02:57:55 GMT
127
+ - request:
128
+ method: post
129
+ uri: https://<host>/services/data/v26.0/sobjects/CustomObjectDetail__c
130
+ body:
131
+ encoding: UTF-8
132
+ string: '{"Name":"Second Detail","CustomObject__c":"a001a000001LS2dAAG"}'
133
+ headers:
134
+ User-Agent:
135
+ - Faraday v0.9.1
136
+ Content-Type:
137
+ - application/json
138
+ Authorization:
139
+ - OAuth 00D1a000000H3O9!AQ4AQNe4R8V.LO2wVndhS1VuuxNtdXS1JCvyNPnzJvH6QSXO9uYDDviw_E1.9iDm2CAsI8PipNylFdpNxUnQrofmMfc7RNsW
140
+ Accept-Encoding:
141
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
142
+ Accept:
143
+ - "*/*"
144
+ response:
145
+ status:
146
+ code: 201
147
+ message: Created
148
+ headers:
149
+ Date:
150
+ - Fri, 10 Apr 2015 02:57:56 GMT
151
+ Set-Cookie:
152
+ - BrowserId=YVyXNj1hQrWqaahZ_coJ7g;Path=/;Domain=.salesforce.com;Expires=Tue,
153
+ 09-Jun-2015 02:57:56 GMT
154
+ Expires:
155
+ - Thu, 01 Jan 1970 00:00:00 GMT
156
+ Sforce-Limit-Info:
157
+ - api-usage=48/15000
158
+ Location:
159
+ - "/services/data/v26.0/sobjects/CustomObjectDetail__c/a011a000000gvbSAAQ"
160
+ Content-Type:
161
+ - application/json;charset=UTF-8
162
+ Transfer-Encoding:
163
+ - chunked
164
+ body:
165
+ encoding: ASCII-8BIT
166
+ string: '{"id":"a011a000000gvbSAAQ","success":true,"errors":[]}'
167
+ http_version:
168
+ recorded_at: Fri, 10 Apr 2015 02:57:57 GMT
169
+ - request:
170
+ method: post
171
+ uri: https://<host>/services/data/v26.0/sobjects/CustomObjectDetail__c
172
+ body:
173
+ encoding: UTF-8
174
+ string: '{"Name":"Third Detail","CustomObject__c":"a001a000001LS2dAAG"}'
175
+ headers:
176
+ User-Agent:
177
+ - Faraday v0.9.1
178
+ Content-Type:
179
+ - application/json
180
+ Authorization:
181
+ - OAuth 00D1a000000H3O9!AQ4AQNe4R8V.LO2wVndhS1VuuxNtdXS1JCvyNPnzJvH6QSXO9uYDDviw_E1.9iDm2CAsI8PipNylFdpNxUnQrofmMfc7RNsW
182
+ Accept-Encoding:
183
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
184
+ Accept:
185
+ - "*/*"
186
+ response:
187
+ status:
188
+ code: 201
189
+ message: Created
190
+ headers:
191
+ Date:
192
+ - Fri, 10 Apr 2015 02:57:58 GMT
193
+ Set-Cookie:
194
+ - BrowserId=d6z2lNgkSf2up8MAXG1a6Q;Path=/;Domain=.salesforce.com;Expires=Tue,
195
+ 09-Jun-2015 02:57:58 GMT
196
+ Expires:
197
+ - Thu, 01 Jan 1970 00:00:00 GMT
198
+ Sforce-Limit-Info:
199
+ - api-usage=49/15000
200
+ Location:
201
+ - "/services/data/v26.0/sobjects/CustomObjectDetail__c/a011a000000gvbXAAQ"
202
+ Content-Type:
203
+ - application/json;charset=UTF-8
204
+ Transfer-Encoding:
205
+ - chunked
206
+ body:
207
+ encoding: ASCII-8BIT
208
+ string: '{"id":"a011a000000gvbXAAQ","success":true,"errors":[]}'
209
+ http_version:
210
+ recorded_at: Fri, 10 Apr 2015 02:57:58 GMT
211
+ - request:
212
+ method: get
213
+ uri: https://<host>/services/data/v26.0/query?q=select%20Id,%20SystemModstamp,%20Name,%20Example_Field__c%20from%20CustomObject__c%20where%20Id%20=%20%27a001a000001LS2dAAG%27
214
+ body:
215
+ encoding: US-ASCII
216
+ string: ''
217
+ headers:
218
+ User-Agent:
219
+ - Faraday v0.9.1
220
+ Authorization:
221
+ - OAuth 00D1a000000H3O9!AQ4AQNe4R8V.LO2wVndhS1VuuxNtdXS1JCvyNPnzJvH6QSXO9uYDDviw_E1.9iDm2CAsI8PipNylFdpNxUnQrofmMfc7RNsW
222
+ Accept-Encoding:
223
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
224
+ Accept:
225
+ - "*/*"
226
+ response:
227
+ status:
228
+ code: 200
229
+ message: OK
230
+ headers:
231
+ Date:
232
+ - Fri, 10 Apr 2015 02:57:59 GMT
233
+ Set-Cookie:
234
+ - BrowserId=mWvixFNmSyqnCFC3TYDC0Q;Path=/;Domain=.salesforce.com;Expires=Tue,
235
+ 09-Jun-2015 02:57:59 GMT
236
+ Expires:
237
+ - Thu, 01 Jan 1970 00:00:00 GMT
238
+ Sforce-Limit-Info:
239
+ - api-usage=48/15000
240
+ Content-Type:
241
+ - application/json;charset=UTF-8
242
+ Transfer-Encoding:
243
+ - chunked
244
+ body:
245
+ encoding: ASCII-8BIT
246
+ string: '{"totalSize":1,"done":true,"records":[{"attributes":{"type":"CustomObject__c","url":"/services/data/v26.0/sobjects/CustomObject__c/a001a000001LS2dAAG"},"Id":"a001a000001LS2dAAG","SystemModstamp":"2015-04-10T02:57:54.000+0000","Name":"Sample
247
+ object","Example_Field__c":null}]}'
248
+ http_version:
249
+ recorded_at: Fri, 10 Apr 2015 02:57:59 GMT
250
+ - request:
251
+ method: get
252
+ uri: https://<host>/services/data/v26.0/query?q=select%20Id,%20SystemModstamp,%20Name,%20CustomObject__c%20from%20CustomObjectDetail__c%20where%20CustomObject__c%20=%20%27a001a000001LS2dAAG%27
253
+ body:
254
+ encoding: US-ASCII
255
+ string: ''
256
+ headers:
257
+ User-Agent:
258
+ - Faraday v0.9.1
259
+ Authorization:
260
+ - OAuth 00D1a000000H3O9!AQ4AQNe4R8V.LO2wVndhS1VuuxNtdXS1JCvyNPnzJvH6QSXO9uYDDviw_E1.9iDm2CAsI8PipNylFdpNxUnQrofmMfc7RNsW
261
+ Accept-Encoding:
262
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
263
+ Accept:
264
+ - "*/*"
265
+ response:
266
+ status:
267
+ code: 200
268
+ message: OK
269
+ headers:
270
+ Date:
271
+ - Fri, 10 Apr 2015 02:58:00 GMT
272
+ Set-Cookie:
273
+ - BrowserId=0GN0ttrKSZavKAuYiSUqIg;Path=/;Domain=.salesforce.com;Expires=Tue,
274
+ 09-Jun-2015 02:58:00 GMT
275
+ Expires:
276
+ - Thu, 01 Jan 1970 00:00:00 GMT
277
+ Sforce-Limit-Info:
278
+ - api-usage=49/15000
279
+ Content-Type:
280
+ - application/json;charset=UTF-8
281
+ Transfer-Encoding:
282
+ - chunked
283
+ body:
284
+ encoding: ASCII-8BIT
285
+ string: '{"totalSize":3,"done":true,"records":[{"attributes":{"type":"CustomObjectDetail__c","url":"/services/data/v26.0/sobjects/CustomObjectDetail__c/a011a000000gvbNAAQ"},"Id":"a011a000000gvbNAAQ","SystemModstamp":"2015-04-10T02:57:55.000+0000","Name":"First
286
+ Detail","CustomObject__c":"a001a000001LS2dAAG"},{"attributes":{"type":"CustomObjectDetail__c","url":"/services/data/v26.0/sobjects/CustomObjectDetail__c/a011a000000gvbXAAQ"},"Id":"a011a000000gvbXAAQ","SystemModstamp":"2015-04-10T02:57:58.000+0000","Name":"Third
287
+ Detail","CustomObject__c":"a001a000001LS2dAAG"},{"attributes":{"type":"CustomObjectDetail__c","url":"/services/data/v26.0/sobjects/CustomObjectDetail__c/a011a000000gvbSAAQ"},"Id":"a011a000000gvbSAAQ","SystemModstamp":"2015-04-10T02:57:57.000+0000","Name":"Second
288
+ Detail","CustomObject__c":"a001a000001LS2dAAG"}]}'
289
+ http_version:
290
+ recorded_at: Fri, 10 Apr 2015 02:58:00 GMT
291
+ - request:
292
+ method: delete
293
+ uri: https://<host>/services/data/v26.0/sobjects/CustomObject__c/a001a000001LS2dAAG
294
+ body:
295
+ encoding: US-ASCII
296
+ string: ''
297
+ headers:
298
+ User-Agent:
299
+ - Faraday v0.9.1
300
+ Authorization:
301
+ - OAuth 00D1a000000H3O9!AQ4AQNe4R8V.LO2wVndhS1VuuxNtdXS1JCvyNPnzJvH6QSXO9uYDDviw_E1.9iDm2CAsI8PipNylFdpNxUnQrofmMfc7RNsW
302
+ Accept-Encoding:
303
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
304
+ Accept:
305
+ - "*/*"
306
+ response:
307
+ status:
308
+ code: 204
309
+ message: No Content
310
+ headers:
311
+ Date:
312
+ - Fri, 10 Apr 2015 02:58:01 GMT
313
+ Set-Cookie:
314
+ - BrowserId=s41Fi0P_T_iCPZZtp-9Efw;Path=/;Domain=.salesforce.com;Expires=Tue,
315
+ 09-Jun-2015 02:58:01 GMT
316
+ Expires:
317
+ - Thu, 01 Jan 1970 00:00:00 GMT
318
+ Sforce-Limit-Info:
319
+ - api-usage=49/15000
320
+ body:
321
+ encoding: UTF-8
322
+ string: ''
323
+ http_version:
324
+ recorded_at: Fri, 10 Apr 2015 02:58:01 GMT
325
+ - request:
326
+ method: delete
327
+ uri: https://<host>/services/data/v26.0/sobjects/CustomObjectDetail__c/a011a000000gvbNAAQ
328
+ body:
329
+ encoding: US-ASCII
330
+ string: ''
331
+ headers:
332
+ User-Agent:
333
+ - Faraday v0.9.1
334
+ Authorization:
335
+ - OAuth 00D1a000000H3O9!AQ4AQNe4R8V.LO2wVndhS1VuuxNtdXS1JCvyNPnzJvH6QSXO9uYDDviw_E1.9iDm2CAsI8PipNylFdpNxUnQrofmMfc7RNsW
336
+ Accept-Encoding:
337
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
338
+ Accept:
339
+ - "*/*"
340
+ response:
341
+ status:
342
+ code: 404
343
+ message: Not Found
344
+ headers:
345
+ Date:
346
+ - Fri, 10 Apr 2015 02:58:02 GMT
347
+ Set-Cookie:
348
+ - BrowserId=x1eXztaBSUWXeuLJMIuz_w;Path=/;Domain=.salesforce.com;Expires=Tue,
349
+ 09-Jun-2015 02:58:02 GMT
350
+ Expires:
351
+ - Thu, 01 Jan 1970 00:00:00 GMT
352
+ Sforce-Limit-Info:
353
+ - api-usage=50/15000
354
+ Content-Type:
355
+ - application/json;charset=UTF-8
356
+ Transfer-Encoding:
357
+ - chunked
358
+ body:
359
+ encoding: UTF-8
360
+ string: '[{"message":"entity is deleted","errorCode":"ENTITY_IS_DELETED","fields":[]}]'
361
+ http_version:
362
+ recorded_at: Fri, 10 Apr 2015 02:58:03 GMT
363
+ - request:
364
+ method: delete
365
+ uri: https://<host>/services/data/v26.0/sobjects/CustomObjectDetail__c/a011a000000gvbSAAQ
366
+ body:
367
+ encoding: US-ASCII
368
+ string: ''
369
+ headers:
370
+ User-Agent:
371
+ - Faraday v0.9.1
372
+ Authorization:
373
+ - OAuth 00D1a000000H3O9!AQ4AQNe4R8V.LO2wVndhS1VuuxNtdXS1JCvyNPnzJvH6QSXO9uYDDviw_E1.9iDm2CAsI8PipNylFdpNxUnQrofmMfc7RNsW
374
+ Accept-Encoding:
375
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
376
+ Accept:
377
+ - "*/*"
378
+ response:
379
+ status:
380
+ code: 404
381
+ message: Not Found
382
+ headers:
383
+ Date:
384
+ - Fri, 10 Apr 2015 02:58:04 GMT
385
+ Set-Cookie:
386
+ - BrowserId=c02nnlKQShmjP8RQBRaTGg;Path=/;Domain=.salesforce.com;Expires=Tue,
387
+ 09-Jun-2015 02:58:04 GMT
388
+ Expires:
389
+ - Thu, 01 Jan 1970 00:00:00 GMT
390
+ Sforce-Limit-Info:
391
+ - api-usage=49/15000
392
+ Content-Type:
393
+ - application/json;charset=UTF-8
394
+ Transfer-Encoding:
395
+ - chunked
396
+ body:
397
+ encoding: UTF-8
398
+ string: '[{"message":"entity is deleted","errorCode":"ENTITY_IS_DELETED","fields":[]}]'
399
+ http_version:
400
+ recorded_at: Fri, 10 Apr 2015 02:58:04 GMT
401
+ - request:
402
+ method: delete
403
+ uri: https://<host>/services/data/v26.0/sobjects/CustomObjectDetail__c/a011a000000gvbXAAQ
404
+ body:
405
+ encoding: US-ASCII
406
+ string: ''
407
+ headers:
408
+ User-Agent:
409
+ - Faraday v0.9.1
410
+ Authorization:
411
+ - OAuth 00D1a000000H3O9!AQ4AQNe4R8V.LO2wVndhS1VuuxNtdXS1JCvyNPnzJvH6QSXO9uYDDviw_E1.9iDm2CAsI8PipNylFdpNxUnQrofmMfc7RNsW
412
+ Accept-Encoding:
413
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
414
+ Accept:
415
+ - "*/*"
416
+ response:
417
+ status:
418
+ code: 404
419
+ message: Not Found
420
+ headers:
421
+ Date:
422
+ - Fri, 10 Apr 2015 02:58:06 GMT
423
+ Set-Cookie:
424
+ - BrowserId=Wk4e4KfeSfKcHiSZ_G5ovw;Path=/;Domain=.salesforce.com;Expires=Tue,
425
+ 09-Jun-2015 02:58:06 GMT
426
+ Expires:
427
+ - Thu, 01 Jan 1970 00:00:00 GMT
428
+ Sforce-Limit-Info:
429
+ - api-usage=49/15000
430
+ Content-Type:
431
+ - application/json;charset=UTF-8
432
+ Transfer-Encoding:
433
+ - chunked
434
+ body:
435
+ encoding: UTF-8
436
+ string: '[{"message":"entity is deleted","errorCode":"ENTITY_IS_DELETED","fields":[]}]'
437
+ http_version:
438
+ recorded_at: Fri, 10 Apr 2015 02:58:06 GMT
439
+ recorded_with: VCR 2.9.3