restforce-db 1.2.9 → 1.2.10
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/association_cache.rb +4 -1
- data/lib/restforce/db/associations/belongs_to.rb +27 -3
- data/lib/restforce/db/associations/has_many.rb +3 -3
- data/lib/restforce/db/associations/has_one.rb +2 -2
- data/lib/restforce/db/associator.rb +104 -0
- data/lib/restforce/db/cleaner.rb +3 -15
- data/lib/restforce/db/collector.rb +2 -4
- data/lib/restforce/db/initializer.rb +10 -10
- data/lib/restforce/db/record_types/active_record.rb +6 -7
- data/lib/restforce/db/record_types/base.rb +0 -2
- data/lib/restforce/db/record_types/salesforce.rb +6 -6
- data/lib/restforce/db/runner.rb +8 -8
- data/lib/restforce/db/runner_cache.rb +93 -0
- data/lib/restforce/db/version.rb +1 -1
- data/lib/restforce/db/worker.rb +23 -9
- data/lib/restforce/db.rb +2 -0
- data/restforce-db.gemspec +3 -3
- data/test/cassettes/Restforce_DB_Associations_BelongsTo/with_an_inverse_mapping/_lookups/returns_a_hash_of_the_associated_records_lookup_IDs.yml +195 -0
- data/test/cassettes/Restforce_DB_Associations_BelongsTo/with_an_inverse_mapping/_lookups/when_there_is_currently_no_associated_record/returns_a_nil_lookup_value_in_the_hash.yml +119 -0
- data/test/cassettes/Restforce_DB_Associator/_run/given_a_BelongsTo_association/given_another_record_for_association/when_the_Salesforce_association_is_out_of_date/updates_the_association_ID_in_Salesforce.yml +421 -0
- data/test/cassettes/Restforce_DB_Associator/_run/given_a_BelongsTo_association/given_another_record_for_association/when_the_database_association_is_out_of_date/updates_the_associated_record_in_the_database.yml +459 -0
- data/test/cassettes/Restforce_DB_RecordTypes_Salesforce/{_each/loops_through_the_existing_records_in_Salesforce.yml → _all/returns_a_list_of_the_existing_records_in_Salesforce.yml} +0 -0
- data/test/lib/restforce/db/accumulator_test.rb +3 -0
- data/test/lib/restforce/db/association_cache_test.rb +8 -0
- data/test/lib/restforce/db/associations/belongs_to_test.rb +18 -0
- data/test/lib/restforce/db/associator_test.rb +82 -0
- data/test/lib/restforce/db/configuration_test.rb +3 -0
- data/test/lib/restforce/db/dsl_test.rb +2 -0
- data/test/lib/restforce/db/record_types/salesforce_test.rb +3 -5
- data/test/lib/restforce/db/runner_cache_test.rb +60 -0
- data/test/lib/restforce/db/runner_test.rb +3 -0
- data/test/lib/restforce/db/strategies/passive_test.rb +3 -0
- data/test/lib/restforce/db/strategy_test.rb +2 -0
- data/test/lib/restforce/db/tracker_test.rb +3 -0
- data/test/support/stub.rb +37 -0
- metadata +18 -9
@@ -0,0 +1,195 @@
|
|
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
|
+
- Mon, 04 May 2015 03:03:46 GMT
|
25
|
+
Set-Cookie:
|
26
|
+
- BrowserId=xEedI-vySRW2ERl7-YhVMQ;Path=/;Domain=.salesforce.com;Expires=Fri,
|
27
|
+
03-Jul-2015 03:03:46 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":"1430708626705","token_type":"Bearer","instance_url":"https://<host>","signature":"l9dFCE7hnrj+RVNOaga2AVC08CivElFFEXzzLx249cg=","access_token":"00D1a000000H3O9!AQ4AQNDrKHLCuinZBZ4a3F0V9mX6K..kuE6uPghr4hEJlGztbaV7OXvvfrl14zZZxgwsTH9RfcLkE1Wikbn..Xma3Bd5XKSX"}'
|
41
|
+
http_version:
|
42
|
+
recorded_at: Mon, 04 May 2015 03:03:46 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!AQ4AQNDrKHLCuinZBZ4a3F0V9mX6K..kuE6uPghr4hEJlGztbaV7OXvvfrl14zZZxgwsTH9RfcLkE1Wikbn..Xma3Bd5XKSX
|
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
|
+
- Mon, 04 May 2015 03:03:47 GMT
|
67
|
+
Set-Cookie:
|
68
|
+
- BrowserId=JXXP7EFFSGmPNZoB147Iaw;Path=/;Domain=.salesforce.com;Expires=Fri,
|
69
|
+
03-Jul-2015 03:03:47 GMT
|
70
|
+
Expires:
|
71
|
+
- Thu, 01 Jan 1970 00:00:00 GMT
|
72
|
+
Sforce-Limit-Info:
|
73
|
+
- api-usage=62/15000
|
74
|
+
Location:
|
75
|
+
- "/services/data/v26.0/sobjects/Contact/0031a00000317qmAAA"
|
76
|
+
Content-Type:
|
77
|
+
- application/json;charset=UTF-8
|
78
|
+
Transfer-Encoding:
|
79
|
+
- chunked
|
80
|
+
body:
|
81
|
+
encoding: ASCII-8BIT
|
82
|
+
string: '{"id":"0031a00000317qmAAA","success":true,"errors":[]}'
|
83
|
+
http_version:
|
84
|
+
recorded_at: Mon, 04 May 2015 03:03:47 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":"0031a00000317qmAAA"}'
|
91
|
+
headers:
|
92
|
+
User-Agent:
|
93
|
+
- Faraday v0.9.1
|
94
|
+
Content-Type:
|
95
|
+
- application/json
|
96
|
+
Authorization:
|
97
|
+
- OAuth 00D1a000000H3O9!AQ4AQNDrKHLCuinZBZ4a3F0V9mX6K..kuE6uPghr4hEJlGztbaV7OXvvfrl14zZZxgwsTH9RfcLkE1Wikbn..Xma3Bd5XKSX
|
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
|
+
- Mon, 04 May 2015 03:03:48 GMT
|
109
|
+
Set-Cookie:
|
110
|
+
- BrowserId=JSTACFWYRfGvSN-pXUImfQ;Path=/;Domain=.salesforce.com;Expires=Fri,
|
111
|
+
03-Jul-2015 03:03:48 GMT
|
112
|
+
Expires:
|
113
|
+
- Thu, 01 Jan 1970 00:00:00 GMT
|
114
|
+
Sforce-Limit-Info:
|
115
|
+
- api-usage=62/15000
|
116
|
+
Location:
|
117
|
+
- "/services/data/v26.0/sobjects/CustomObject__c/a001a000001U16LAAS"
|
118
|
+
Content-Type:
|
119
|
+
- application/json;charset=UTF-8
|
120
|
+
Transfer-Encoding:
|
121
|
+
- chunked
|
122
|
+
body:
|
123
|
+
encoding: ASCII-8BIT
|
124
|
+
string: '{"id":"a001a000001U16LAAS","success":true,"errors":[]}'
|
125
|
+
http_version:
|
126
|
+
recorded_at: Mon, 04 May 2015 03:03:49 GMT
|
127
|
+
- request:
|
128
|
+
method: delete
|
129
|
+
uri: https://<host>/services/data/v26.0/sobjects/Contact/0031a00000317qmAAA
|
130
|
+
body:
|
131
|
+
encoding: US-ASCII
|
132
|
+
string: ''
|
133
|
+
headers:
|
134
|
+
User-Agent:
|
135
|
+
- Faraday v0.9.1
|
136
|
+
Authorization:
|
137
|
+
- OAuth 00D1a000000H3O9!AQ4AQNDrKHLCuinZBZ4a3F0V9mX6K..kuE6uPghr4hEJlGztbaV7OXvvfrl14zZZxgwsTH9RfcLkE1Wikbn..Xma3Bd5XKSX
|
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: 204
|
145
|
+
message: No Content
|
146
|
+
headers:
|
147
|
+
Date:
|
148
|
+
- Mon, 04 May 2015 03:03:49 GMT
|
149
|
+
Set-Cookie:
|
150
|
+
- BrowserId=fw6pUrTnSsaUmxeHralylA;Path=/;Domain=.salesforce.com;Expires=Fri,
|
151
|
+
03-Jul-2015 03:03:49 GMT
|
152
|
+
Expires:
|
153
|
+
- Thu, 01 Jan 1970 00:00:00 GMT
|
154
|
+
Sforce-Limit-Info:
|
155
|
+
- api-usage=62/15000
|
156
|
+
body:
|
157
|
+
encoding: UTF-8
|
158
|
+
string: ''
|
159
|
+
http_version:
|
160
|
+
recorded_at: Mon, 04 May 2015 03:03:50 GMT
|
161
|
+
- request:
|
162
|
+
method: delete
|
163
|
+
uri: https://<host>/services/data/v26.0/sobjects/CustomObject__c/a001a000001U16LAAS
|
164
|
+
body:
|
165
|
+
encoding: US-ASCII
|
166
|
+
string: ''
|
167
|
+
headers:
|
168
|
+
User-Agent:
|
169
|
+
- Faraday v0.9.1
|
170
|
+
Authorization:
|
171
|
+
- OAuth 00D1a000000H3O9!AQ4AQNDrKHLCuinZBZ4a3F0V9mX6K..kuE6uPghr4hEJlGztbaV7OXvvfrl14zZZxgwsTH9RfcLkE1Wikbn..Xma3Bd5XKSX
|
172
|
+
Accept-Encoding:
|
173
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
174
|
+
Accept:
|
175
|
+
- "*/*"
|
176
|
+
response:
|
177
|
+
status:
|
178
|
+
code: 204
|
179
|
+
message: No Content
|
180
|
+
headers:
|
181
|
+
Date:
|
182
|
+
- Mon, 04 May 2015 03:03:51 GMT
|
183
|
+
Set-Cookie:
|
184
|
+
- BrowserId=dZMbqhy9So-af3I7wNJe7w;Path=/;Domain=.salesforce.com;Expires=Fri,
|
185
|
+
03-Jul-2015 03:03:51 GMT
|
186
|
+
Expires:
|
187
|
+
- Thu, 01 Jan 1970 00:00:00 GMT
|
188
|
+
Sforce-Limit-Info:
|
189
|
+
- api-usage=62/15000
|
190
|
+
body:
|
191
|
+
encoding: UTF-8
|
192
|
+
string: ''
|
193
|
+
http_version:
|
194
|
+
recorded_at: Mon, 04 May 2015 03:03:51 GMT
|
195
|
+
recorded_with: VCR 2.9.3
|
@@ -0,0 +1,119 @@
|
|
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
|
+
- Mon, 04 May 2015 03:11:53 GMT
|
25
|
+
Set-Cookie:
|
26
|
+
- BrowserId=xMX1dTw3TIGcKjfx_Cujpw;Path=/;Domain=.salesforce.com;Expires=Fri,
|
27
|
+
03-Jul-2015 03:11:53 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":"1430709113521","token_type":"Bearer","instance_url":"https://<host>","signature":"2BWFc3pyXdIWgSNtXnE+OpZDdD+Oas7Mk3KKVvtfEzw=","access_token":"00D1a000000H3O9!AQ4AQNDrKHLCuinZBZ4a3F0V9mX6K..kuE6uPghr4hEJlGztbaV7OXvvfrl14zZZxgwsTH9RfcLkE1Wikbn..Xma3Bd5XKSX"}'
|
41
|
+
http_version:
|
42
|
+
recorded_at: Mon, 04 May 2015 03:11:53 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!AQ4AQNDrKHLCuinZBZ4a3F0V9mX6K..kuE6uPghr4hEJlGztbaV7OXvvfrl14zZZxgwsTH9RfcLkE1Wikbn..Xma3Bd5XKSX
|
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
|
+
- Mon, 04 May 2015 03:11:54 GMT
|
67
|
+
Set-Cookie:
|
68
|
+
- BrowserId=5-H8lcRDTYW0wIDWnj21qA;Path=/;Domain=.salesforce.com;Expires=Fri,
|
69
|
+
03-Jul-2015 03:11:54 GMT
|
70
|
+
Expires:
|
71
|
+
- Thu, 01 Jan 1970 00:00:00 GMT
|
72
|
+
Sforce-Limit-Info:
|
73
|
+
- api-usage=66/15000
|
74
|
+
Location:
|
75
|
+
- "/services/data/v26.0/sobjects/CustomObject__c/a001a000001U16VAAS"
|
76
|
+
Content-Type:
|
77
|
+
- application/json;charset=UTF-8
|
78
|
+
Transfer-Encoding:
|
79
|
+
- chunked
|
80
|
+
body:
|
81
|
+
encoding: ASCII-8BIT
|
82
|
+
string: '{"id":"a001a000001U16VAAS","success":true,"errors":[]}'
|
83
|
+
http_version:
|
84
|
+
recorded_at: Mon, 04 May 2015 03:11:54 GMT
|
85
|
+
- request:
|
86
|
+
method: delete
|
87
|
+
uri: https://<host>/services/data/v26.0/sobjects/CustomObject__c/a001a000001U16VAAS
|
88
|
+
body:
|
89
|
+
encoding: US-ASCII
|
90
|
+
string: ''
|
91
|
+
headers:
|
92
|
+
User-Agent:
|
93
|
+
- Faraday v0.9.1
|
94
|
+
Authorization:
|
95
|
+
- OAuth 00D1a000000H3O9!AQ4AQNDrKHLCuinZBZ4a3F0V9mX6K..kuE6uPghr4hEJlGztbaV7OXvvfrl14zZZxgwsTH9RfcLkE1Wikbn..Xma3Bd5XKSX
|
96
|
+
Accept-Encoding:
|
97
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
98
|
+
Accept:
|
99
|
+
- "*/*"
|
100
|
+
response:
|
101
|
+
status:
|
102
|
+
code: 204
|
103
|
+
message: No Content
|
104
|
+
headers:
|
105
|
+
Date:
|
106
|
+
- Mon, 04 May 2015 03:11:55 GMT
|
107
|
+
Set-Cookie:
|
108
|
+
- BrowserId=7IbTrRJmRZCYf_zWQWFUKQ;Path=/;Domain=.salesforce.com;Expires=Fri,
|
109
|
+
03-Jul-2015 03:11:55 GMT
|
110
|
+
Expires:
|
111
|
+
- Thu, 01 Jan 1970 00:00:00 GMT
|
112
|
+
Sforce-Limit-Info:
|
113
|
+
- api-usage=66/15000
|
114
|
+
body:
|
115
|
+
encoding: UTF-8
|
116
|
+
string: ''
|
117
|
+
http_version:
|
118
|
+
recorded_at: Mon, 04 May 2015 03:11:55 GMT
|
119
|
+
recorded_with: VCR 2.9.3
|