restforce-db 1.2.7 → 1.2.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +16 -6
- data/lib/restforce/db/association_cache.rb +49 -0
- data/lib/restforce/db/associations/base.rb +7 -5
- data/lib/restforce/db/associations/belongs_to.rb +6 -1
- data/lib/restforce/db/associations/has_many.rb +6 -1
- data/lib/restforce/db/associations/has_one.rb +6 -1
- data/lib/restforce/db/version.rb +1 -1
- data/lib/restforce/db.rb +1 -0
- data/test/cassettes/Restforce_DB_Associations_BelongsTo/with_an_inverse_mapping/_build/{when_the_associated_record_has_alrady_been_persisted → when_the_associated_record_has_already_been_persisted}/assigns_the_existing_record.yml +0 -0
- data/test/cassettes/Restforce_DB_Associations_BelongsTo/with_an_inverse_mapping/_build/when_the_associated_record_has_been_cached/uses_the_cached_record.yml +271 -0
- data/test/cassettes/Restforce_DB_Associations_HasMany/with_an_inverse_mapping/_build/when_the_associated_records_have_been_cached/uses_the_cached_records.yml +439 -0
- data/test/cassettes/Restforce_DB_Associations_HasOne/with_an_inverse_mapping/_build/when_the_associated_record_has_already_been_persisted/assigns_the_existing_record.yml +271 -0
- data/test/cassettes/Restforce_DB_Associations_HasOne/with_an_inverse_mapping/_build/when_the_associated_record_has_been_cached/uses_the_cached_record.yml +271 -0
- data/test/lib/restforce/db/association_cache_test.rb +63 -0
- data/test/lib/restforce/db/associations/belongs_to_test.rb +14 -2
- data/test/lib/restforce/db/associations/has_many_test.rb +17 -1
- data/test/lib/restforce/db/associations/has_one_test.rb +24 -0
- metadata +9 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9cf7836ccb586e04a24d23816d7c0ccea2c46ea9
|
4
|
+
data.tar.gz: 089b7c3596be1f796de185ca25ded3a613f19848
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a4e81d52fc31bfdc3104b9720bceb1931410b7ad39d675a8bd9d172d1acedb3b99efe1f2c62937dca9d7b1c2fee57ad52161883988f0522df0876e41ed9552d4
|
7
|
+
data.tar.gz: c0153e58647b5f60bbb610f9b8bb56c65bed0bc514f1d22f31567274bd56c368185f8798ca63359fb4635c51af0764abece5e947a717bb9d5c855dcd09371b51
|
data/README.md
CHANGED
@@ -39,7 +39,7 @@ To register a Salesforce mapping in an `ActiveRecord` model, you'll need to add
|
|
39
39
|
class Restaurant < ActiveRecord::Base
|
40
40
|
|
41
41
|
include Restforce::DB::Model
|
42
|
-
has_one :chef, inverse_of: :restaurant
|
42
|
+
has_one :chef, inverse_of: :restaurant, autosave: true
|
43
43
|
has_many :dishes, inverse_of: :restaurant
|
44
44
|
|
45
45
|
module StyleAdapter
|
@@ -202,17 +202,27 @@ For additional information and a full set of options, you can run:
|
|
202
202
|
|
203
203
|
$ bundle exec bin/restforce-db -h
|
204
204
|
|
205
|
+
## Caveats
|
206
|
+
|
207
|
+
- **API Usage.**
|
208
|
+
This gem performs most of its functionality via the Salesforce API (by way of the [`restforce`](https://github.com/ejholmes/restforce) gem). If you're at risk of hitting your Salesforce API limits, this may not be the right approach for you.
|
209
|
+
|
210
|
+
- **Update Prioritization.**
|
211
|
+
When synchronization occurs, the most recently updated record, Salesforce or database, gets to make the final call about the values of _all_ of the fields it observes. This means that race conditions can and probably will happen if both systems are updated within the same polling interval.
|
212
|
+
|
213
|
+
- **Record Persistence.**
|
214
|
+
See the `autosave: true` option declared for the `has_one` relationship on `Restaurant`? `Restforce::DB` requires your ActiveRecord models to handle persistence propagation.
|
215
|
+
|
216
|
+
When inserting new records, `save!` will only be invoked on the _entry point_ record (typically a mapping with an `:always` synchronization strategy), so the persistence of any associated records must be chained through this "root" object.
|
217
|
+
|
218
|
+
You may want to consult [the ActiveRecord documentation](http://apidock.com/rails/ActiveRecord/Associations/ClassMethods) for your specific use case.
|
219
|
+
|
205
220
|
## Development
|
206
221
|
|
207
222
|
After checking out the repo, run `bin/setup` to install dependencies. Then, run `bin/console` for an interactive prompt that will allow you to experiment.
|
208
223
|
|
209
224
|
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release` to create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
210
225
|
|
211
|
-
## Caveats
|
212
|
-
|
213
|
-
- **Update Prioritization.** When synchronization occurs, the most recently updated record, Salesforce or database, gets to make the final call about the values of _all_ of the fields it observes. This means that race conditions can and probably will happen if both systems are updated within the same polling interval.
|
214
|
-
- **API Usage.** This gem performs most of its functionality via the Salesforce API (by way of the [`restforce`](https://github.com/ejholmes/restforce) gem). If you're at risk of hitting your Salesforce API limits, this may not be the right approach for you.
|
215
|
-
|
216
226
|
## Contributing
|
217
227
|
|
218
228
|
1. Fork it ( https://github.com/tablexi/restforce-db/fork )
|
@@ -0,0 +1,49 @@
|
|
1
|
+
module Restforce
|
2
|
+
|
3
|
+
module DB
|
4
|
+
|
5
|
+
# Restforce::DB::AssociationCache stores a set of constructed database
|
6
|
+
# association records, providing utilities to fetch unpersisted records
|
7
|
+
# which match a specific set of Salesforce lookups.
|
8
|
+
class AssociationCache
|
9
|
+
|
10
|
+
attr_reader :cache
|
11
|
+
|
12
|
+
# Public: Initialize a new Restforce::DB::AssociationCache.
|
13
|
+
def initialize
|
14
|
+
@cache = Hash.new { |h, k| h[k] = [] }
|
15
|
+
end
|
16
|
+
|
17
|
+
# Public: Add a record to the cache.
|
18
|
+
#
|
19
|
+
# record - An instance of ActiveRecord::Base.
|
20
|
+
#
|
21
|
+
# Returns nothing.
|
22
|
+
def <<(record)
|
23
|
+
@cache[record.class] << record
|
24
|
+
end
|
25
|
+
|
26
|
+
# Public: Find an existing record with the given lookup values.
|
27
|
+
#
|
28
|
+
# database_model - A subclass of ActiveRecord::Base.
|
29
|
+
# lookups - A Hash mapping database columns to Salesforce IDs.
|
30
|
+
#
|
31
|
+
# Returns an instance of ActiveRecord::Base or nil.
|
32
|
+
def find(database_model, lookups)
|
33
|
+
record = @cache[database_model].detect do |cached|
|
34
|
+
lookups.all? { |column, value| cached.send(column) == value }
|
35
|
+
end
|
36
|
+
|
37
|
+
return record if record
|
38
|
+
|
39
|
+
record = database_model.find_by(lookups)
|
40
|
+
self << record if record
|
41
|
+
|
42
|
+
record
|
43
|
+
end
|
44
|
+
|
45
|
+
end
|
46
|
+
|
47
|
+
end
|
48
|
+
|
49
|
+
end
|
@@ -8,7 +8,7 @@ module Restforce
|
|
8
8
|
# mappings in the Registry.
|
9
9
|
class Base
|
10
10
|
|
11
|
-
attr_reader :name, :lookup
|
11
|
+
attr_reader :name, :lookup, :cache
|
12
12
|
|
13
13
|
# Public: Initialize a new Restforce::DB::Associations::Base.
|
14
14
|
#
|
@@ -23,7 +23,7 @@ module Restforce
|
|
23
23
|
# defined by this class. Must be overridden in subclasses.
|
24
24
|
#
|
25
25
|
# Raises a NotImplementedError.
|
26
|
-
def build(_database_record, _salesforce_record)
|
26
|
+
def build(_database_record, _salesforce_record, _cache)
|
27
27
|
raise NotImplementedError
|
28
28
|
end
|
29
29
|
|
@@ -65,7 +65,7 @@ module Restforce
|
|
65
65
|
# Yields the new database record if one is built.
|
66
66
|
# Returns an Array containing all newly-constructed records.
|
67
67
|
def constructed_records(database_record, lookups, attributes)
|
68
|
-
associated = target_class(database_record)
|
68
|
+
associated = cache.find(target_class(database_record), lookups)
|
69
69
|
|
70
70
|
# If the association record already exists, we don't need to build out
|
71
71
|
# associations any further.
|
@@ -74,7 +74,9 @@ module Restforce
|
|
74
74
|
return []
|
75
75
|
end
|
76
76
|
|
77
|
-
associated
|
77
|
+
associated = database_record.association(name).build(lookups)
|
78
|
+
cache << associated
|
79
|
+
|
78
80
|
associated.assign_attributes(attributes)
|
79
81
|
|
80
82
|
nested = yield associated if block_given?
|
@@ -164,7 +166,7 @@ module Restforce
|
|
164
166
|
inverse = inverse_association_name(target_reflection(parent_record))
|
165
167
|
nested = salesforce_instance.mapping.associations.flat_map do |a|
|
166
168
|
next if a.name == inverse
|
167
|
-
a.build(database_record, salesforce_instance.record)
|
169
|
+
a.build(database_record, salesforce_instance.record, cache)
|
168
170
|
end
|
169
171
|
|
170
172
|
nested.compact
|
@@ -14,9 +14,12 @@ module Restforce
|
|
14
14
|
#
|
15
15
|
# database_record - An instance of an ActiveRecord::Base subclass.
|
16
16
|
# salesforce_record - A Hashie::Mash representing a Salesforce object.
|
17
|
+
# cache - A Restforce::DB::AssociationCache.
|
17
18
|
#
|
18
19
|
# Returns an Array of constructed association records.
|
19
|
-
def build(database_record, salesforce_record)
|
20
|
+
def build(database_record, salesforce_record, cache = AssociationCache.new)
|
21
|
+
@cache = cache
|
22
|
+
|
20
23
|
lookups = {}
|
21
24
|
attributes = {}
|
22
25
|
instances = []
|
@@ -38,6 +41,8 @@ module Restforce
|
|
38
41
|
constructed_records(database_record, lookups, attributes) do |associated|
|
39
42
|
instances.flat_map { |i| nested_records(database_record, associated, i) }
|
40
43
|
end
|
44
|
+
ensure
|
45
|
+
@cache = nil
|
41
46
|
end
|
42
47
|
|
43
48
|
private
|
@@ -14,9 +14,12 @@ module Restforce
|
|
14
14
|
#
|
15
15
|
# database_record - An instance of an ActiveRecord::Base subclass.
|
16
16
|
# salesforce_record - A Hashie::Mash representing a Salesforce object.
|
17
|
+
# cache - A Restforce::DB::AssociationCache.
|
17
18
|
#
|
18
19
|
# Returns an Array of constructed association records.
|
19
|
-
def build(database_record, salesforce_record)
|
20
|
+
def build(database_record, salesforce_record, cache = AssociationCache.new)
|
21
|
+
@cache = cache
|
22
|
+
|
20
23
|
target = target_mapping(database_record)
|
21
24
|
lookup_id = "#{lookup} = '#{salesforce_record.Id}'"
|
22
25
|
|
@@ -26,6 +29,8 @@ module Restforce
|
|
26
29
|
end
|
27
30
|
|
28
31
|
records.flatten
|
32
|
+
ensure
|
33
|
+
@cache = nil
|
29
34
|
end
|
30
35
|
|
31
36
|
private
|
@@ -14,14 +14,19 @@ module Restforce
|
|
14
14
|
#
|
15
15
|
# database_record - An instance of an ActiveRecord::Base subclass.
|
16
16
|
# salesforce_record - A Hashie::Mash representing a Salesforce object.
|
17
|
+
# cache - A Restforce::DB::AssociationCache.
|
17
18
|
#
|
18
19
|
# Returns an Array of constructed association records.
|
19
|
-
def build(database_record, salesforce_record)
|
20
|
+
def build(database_record, salesforce_record, cache = AssociationCache.new)
|
21
|
+
@cache = cache
|
22
|
+
|
20
23
|
target = target_mapping(database_record)
|
21
24
|
query = "#{lookup} = '#{salesforce_record.Id}'"
|
22
25
|
|
23
26
|
instance = target.salesforce_record_type.first(query)
|
24
27
|
instance ? construct_for(database_record, instance) : []
|
28
|
+
ensure
|
29
|
+
@cache = nil
|
25
30
|
end
|
26
31
|
|
27
32
|
end
|
data/lib/restforce/db/version.rb
CHANGED
data/lib/restforce/db.rb
CHANGED
@@ -9,6 +9,7 @@ require "restforce/db/registry"
|
|
9
9
|
require "restforce/db/strategy"
|
10
10
|
require "restforce/db/dsl"
|
11
11
|
|
12
|
+
require "restforce/db/association_cache"
|
12
13
|
require "restforce/db/associations/base"
|
13
14
|
require "restforce/db/associations/belongs_to"
|
14
15
|
require "restforce/db/associations/foreign_key"
|
File without changes
|
@@ -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
|
+
- Fri, 01 May 2015 16:33:24 GMT
|
25
|
+
Set-Cookie:
|
26
|
+
- BrowserId=V4xV6073TGS_LEesUDd-EA;Path=/;Domain=.salesforce.com;Expires=Tue,
|
27
|
+
30-Jun-2015 16:33:24 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":"1430498004388","token_type":"Bearer","instance_url":"https://<host>","signature":"UlHQTMd5UMeQOcODXUr6CtDraNkn2Wq50gFTzKBlpT8=","access_token":"00D1a000000H3O9!AQ4AQDv3Hk9TRSKHVK.6TQHDjiXPpFDEH7AxoxdK.ytZcKr4gkBGokBh2ZhUcaf0_eFqhFa6YVCzmfP.bUKsz9xIJOy41iQD"}'
|
41
|
+
http_version:
|
42
|
+
recorded_at: Fri, 01 May 2015 16:33:24 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!AQ4AQDv3Hk9TRSKHVK.6TQHDjiXPpFDEH7AxoxdK.ytZcKr4gkBGokBh2ZhUcaf0_eFqhFa6YVCzmfP.bUKsz9xIJOy41iQD
|
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, 01 May 2015 16:33:24 GMT
|
67
|
+
Set-Cookie:
|
68
|
+
- BrowserId=7i8VqQngSSqFKsKsi7Vk_g;Path=/;Domain=.salesforce.com;Expires=Tue,
|
69
|
+
30-Jun-2015 16:33:24 GMT
|
70
|
+
Expires:
|
71
|
+
- Thu, 01 Jan 1970 00:00:00 GMT
|
72
|
+
Sforce-Limit-Info:
|
73
|
+
- api-usage=14/15000
|
74
|
+
Location:
|
75
|
+
- "/services/data/v26.0/sobjects/Contact/0031a000002jr5yAAA"
|
76
|
+
Content-Type:
|
77
|
+
- application/json;charset=UTF-8
|
78
|
+
Transfer-Encoding:
|
79
|
+
- chunked
|
80
|
+
body:
|
81
|
+
encoding: ASCII-8BIT
|
82
|
+
string: '{"id":"0031a000002jr5yAAA","success":true,"errors":[]}'
|
83
|
+
http_version:
|
84
|
+
recorded_at: Fri, 01 May 2015 16:33:24 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":"0031a000002jr5yAAA"}'
|
91
|
+
headers:
|
92
|
+
User-Agent:
|
93
|
+
- Faraday v0.9.1
|
94
|
+
Content-Type:
|
95
|
+
- application/json
|
96
|
+
Authorization:
|
97
|
+
- OAuth 00D1a000000H3O9!AQ4AQDv3Hk9TRSKHVK.6TQHDjiXPpFDEH7AxoxdK.ytZcKr4gkBGokBh2ZhUcaf0_eFqhFa6YVCzmfP.bUKsz9xIJOy41iQD
|
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, 01 May 2015 16:33:24 GMT
|
109
|
+
Set-Cookie:
|
110
|
+
- BrowserId=HqVkQER3SLGWhf169ZcfYw;Path=/;Domain=.salesforce.com;Expires=Tue,
|
111
|
+
30-Jun-2015 16:33:24 GMT
|
112
|
+
Expires:
|
113
|
+
- Thu, 01 Jan 1970 00:00:00 GMT
|
114
|
+
Sforce-Limit-Info:
|
115
|
+
- api-usage=14/15000
|
116
|
+
Location:
|
117
|
+
- "/services/data/v26.0/sobjects/CustomObject__c/a001a000001TuPCAA0"
|
118
|
+
Content-Type:
|
119
|
+
- application/json;charset=UTF-8
|
120
|
+
Transfer-Encoding:
|
121
|
+
- chunked
|
122
|
+
body:
|
123
|
+
encoding: ASCII-8BIT
|
124
|
+
string: '{"id":"a001a000001TuPCAA0","success":true,"errors":[]}'
|
125
|
+
http_version:
|
126
|
+
recorded_at: Fri, 01 May 2015 16:33:25 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%27a001a000001TuPCAA0%27
|
130
|
+
body:
|
131
|
+
encoding: US-ASCII
|
132
|
+
string: ''
|
133
|
+
headers:
|
134
|
+
User-Agent:
|
135
|
+
- Faraday v0.9.1
|
136
|
+
Authorization:
|
137
|
+
- OAuth 00D1a000000H3O9!AQ4AQDv3Hk9TRSKHVK.6TQHDjiXPpFDEH7AxoxdK.ytZcKr4gkBGokBh2ZhUcaf0_eFqhFa6YVCzmfP.bUKsz9xIJOy41iQD
|
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
|
+
- Fri, 01 May 2015 16:33:25 GMT
|
149
|
+
Set-Cookie:
|
150
|
+
- BrowserId=HFIYWjmgQESnRKolxabijg;Path=/;Domain=.salesforce.com;Expires=Tue,
|
151
|
+
30-Jun-2015 16:33:25 GMT
|
152
|
+
Expires:
|
153
|
+
- Thu, 01 Jan 1970 00:00:00 GMT
|
154
|
+
Sforce-Limit-Info:
|
155
|
+
- api-usage=14/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/a001a000001TuPCAA0"},"Id":"a001a000001TuPCAA0","SystemModstamp":"2015-05-01T16:33:24.000+0000","Name":"a001a000001TuPC","Example_Field__c":null,"Friend__c":"0031a000002jr5yAAA"}]}'
|
163
|
+
http_version:
|
164
|
+
recorded_at: Fri, 01 May 2015 16:33:25 GMT
|
165
|
+
- request:
|
166
|
+
method: get
|
167
|
+
uri: https://<host>/services/data/v26.0/query?q=select%20Id,%20SystemModstamp,%20Email%20from%20Contact%20where%20Id%20=%20%270031a000002jr5yAAA%27
|
168
|
+
body:
|
169
|
+
encoding: US-ASCII
|
170
|
+
string: ''
|
171
|
+
headers:
|
172
|
+
User-Agent:
|
173
|
+
- Faraday v0.9.1
|
174
|
+
Authorization:
|
175
|
+
- OAuth 00D1a000000H3O9!AQ4AQDv3Hk9TRSKHVK.6TQHDjiXPpFDEH7AxoxdK.ytZcKr4gkBGokBh2ZhUcaf0_eFqhFa6YVCzmfP.bUKsz9xIJOy41iQD
|
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
|
+
- Fri, 01 May 2015 16:33:25 GMT
|
187
|
+
Set-Cookie:
|
188
|
+
- BrowserId=fbjM_aMCQk-C-vEXZy2qsg;Path=/;Domain=.salesforce.com;Expires=Tue,
|
189
|
+
30-Jun-2015 16:33:25 GMT
|
190
|
+
Expires:
|
191
|
+
- Thu, 01 Jan 1970 00:00:00 GMT
|
192
|
+
Sforce-Limit-Info:
|
193
|
+
- api-usage=16/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":"Contact","url":"/services/data/v26.0/sobjects/Contact/0031a000002jr5yAAA"},"Id":"0031a000002jr5yAAA","SystemModstamp":"2015-05-01T16:33:24.000+0000","Email":"somebody@example.com"}]}'
|
201
|
+
http_version:
|
202
|
+
recorded_at: Fri, 01 May 2015 16:33:25 GMT
|
203
|
+
- request:
|
204
|
+
method: delete
|
205
|
+
uri: https://<host>/services/data/v26.0/sobjects/Contact/0031a000002jr5yAAA
|
206
|
+
body:
|
207
|
+
encoding: US-ASCII
|
208
|
+
string: ''
|
209
|
+
headers:
|
210
|
+
User-Agent:
|
211
|
+
- Faraday v0.9.1
|
212
|
+
Authorization:
|
213
|
+
- OAuth 00D1a000000H3O9!AQ4AQDv3Hk9TRSKHVK.6TQHDjiXPpFDEH7AxoxdK.ytZcKr4gkBGokBh2ZhUcaf0_eFqhFa6YVCzmfP.bUKsz9xIJOy41iQD
|
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
|
+
- Fri, 01 May 2015 16:33:25 GMT
|
225
|
+
Set-Cookie:
|
226
|
+
- BrowserId=9sf6dtHySYeEZem-2Pu2UA;Path=/;Domain=.salesforce.com;Expires=Tue,
|
227
|
+
30-Jun-2015 16:33:25 GMT
|
228
|
+
Expires:
|
229
|
+
- Thu, 01 Jan 1970 00:00:00 GMT
|
230
|
+
Sforce-Limit-Info:
|
231
|
+
- api-usage=15/15000
|
232
|
+
body:
|
233
|
+
encoding: UTF-8
|
234
|
+
string: ''
|
235
|
+
http_version:
|
236
|
+
recorded_at: Fri, 01 May 2015 16:33:25 GMT
|
237
|
+
- request:
|
238
|
+
method: delete
|
239
|
+
uri: https://<host>/services/data/v26.0/sobjects/CustomObject__c/a001a000001TuPCAA0
|
240
|
+
body:
|
241
|
+
encoding: US-ASCII
|
242
|
+
string: ''
|
243
|
+
headers:
|
244
|
+
User-Agent:
|
245
|
+
- Faraday v0.9.1
|
246
|
+
Authorization:
|
247
|
+
- OAuth 00D1a000000H3O9!AQ4AQDv3Hk9TRSKHVK.6TQHDjiXPpFDEH7AxoxdK.ytZcKr4gkBGokBh2ZhUcaf0_eFqhFa6YVCzmfP.bUKsz9xIJOy41iQD
|
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
|
+
- Fri, 01 May 2015 16:33:25 GMT
|
259
|
+
Set-Cookie:
|
260
|
+
- BrowserId=kXuMYUa-TeafZ0Rlz2v3Tw;Path=/;Domain=.salesforce.com;Expires=Tue,
|
261
|
+
30-Jun-2015 16:33:25 GMT
|
262
|
+
Expires:
|
263
|
+
- Thu, 01 Jan 1970 00:00:00 GMT
|
264
|
+
Sforce-Limit-Info:
|
265
|
+
- api-usage=14/15000
|
266
|
+
body:
|
267
|
+
encoding: UTF-8
|
268
|
+
string: ''
|
269
|
+
http_version:
|
270
|
+
recorded_at: Fri, 01 May 2015 16:33:26 GMT
|
271
|
+
recorded_with: VCR 2.9.3
|