restforce-db 2.2.2 → 2.2.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (77) hide show
  1. checksums.yaml +4 -4
  2. data/lib/restforce/db/associator.rb +1 -1
  3. data/lib/restforce/db/initializer.rb +2 -2
  4. data/lib/restforce/db/instances/active_record.rb +18 -8
  5. data/lib/restforce/db/instances/salesforce.rb +9 -0
  6. data/lib/restforce/db/synchronization_error.rb +40 -0
  7. data/lib/restforce/db/synchronizer.rb +15 -9
  8. data/lib/restforce/db/version.rb +1 -1
  9. data/lib/restforce/db.rb +9 -0
  10. data/test/cassettes/Restforce_DB_Associations_BelongsTo/with_an_inverse_mapping/_build/returns_an_associated_record_populated_with_the_Salesforce_attributes.yml +55 -55
  11. data/test/cassettes/Restforce_DB_Associations_BelongsTo/with_an_inverse_mapping/_build/when_no_salesforce_record_is_found_for_the_association/proceeds_without_constructing_any_records.yml +40 -40
  12. data/test/cassettes/Restforce_DB_Associations_BelongsTo/with_an_inverse_mapping/_build/when_the_associated_record_has_already_been_persisted/assigns_the_existing_record.yml +59 -59
  13. data/test/cassettes/Restforce_DB_Associations_BelongsTo/with_an_inverse_mapping/_build/when_the_associated_record_has_been_cached/uses_the_cached_record.yml +59 -59
  14. data/test/cassettes/Restforce_DB_Associations_BelongsTo/with_an_inverse_mapping/_build/when_the_association_is_non-building/proceeds_without_constructing_any_records.yml +50 -50
  15. data/test/cassettes/Restforce_DB_Associations_BelongsTo/with_an_inverse_mapping/_build/with_an_unrelated_association_mapping/proceeds_without_raising_an_error.yml +59 -59
  16. data/test/cassettes/Restforce_DB_Associations_BelongsTo/with_an_inverse_mapping/_lookups/returns_a_hash_of_the_associated_records_lookup_IDs.yml +41 -41
  17. data/test/cassettes/Restforce_DB_Associations_BelongsTo/with_an_inverse_mapping/_lookups/when_there_is_currently_no_associated_record/and_the_underlying_association_is_one-to-many/still_returns_a_nil_lookup_value_in_the_hash.yml +20 -20
  18. 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 +23 -23
  19. data/test/cassettes/Restforce_DB_Associations_BelongsTo/with_an_inverse_mapping/_synced_for_/when_a_matching_associated_record_has_been_synchronized/returns_true.yml +58 -58
  20. data/test/cassettes/Restforce_DB_Associations_BelongsTo/with_an_inverse_mapping/_synced_for_/when_no_matching_associated_record_has_been_synchronized/returns_false.yml +58 -58
  21. data/test/cassettes/Restforce_DB_Associations_HasMany/with_an_inverse_mapping/_build/builds_a_number_of_associated_records_from_the_data_in_Salesforce.yml +98 -98
  22. data/test/cassettes/Restforce_DB_Associations_HasMany/with_an_inverse_mapping/_build/when_no_salesforce_record_is_found_for_the_association/proceeds_without_constructing_any_records.yml +40 -40
  23. data/test/cassettes/Restforce_DB_Associations_HasMany/with_an_inverse_mapping/_build/when_the_associated_records_have_alrady_been_persisted/constructs_the_association_from_the_existing_records.yml +98 -98
  24. data/test/cassettes/Restforce_DB_Associations_HasMany/with_an_inverse_mapping/_build/when_the_associated_records_have_been_cached/uses_the_cached_records.yml +98 -98
  25. data/test/cassettes/Restforce_DB_Associations_HasMany/with_an_inverse_mapping/_build/when_the_association_is_non-building/proceeds_without_constructing_any_records.yml +32 -32
  26. data/test/cassettes/Restforce_DB_Associations_HasMany/with_an_inverse_mapping/_synced_for_/when_a_matching_associated_record_has_been_synchronized/returns_true.yml +98 -98
  27. data/test/cassettes/Restforce_DB_Associations_HasMany/with_an_inverse_mapping/_synced_for_/when_no_matching_associated_record_has_been_synchronized/returns_false.yml +40 -40
  28. data/test/cassettes/Restforce_DB_Associations_HasOne/with_an_inverse_mapping/_build/and_a_nested_association_on_the_associated_mapping/recursively_builds_all_associations.yml +86 -86
  29. data/test/cassettes/Restforce_DB_Associations_HasOne/with_an_inverse_mapping/_build/returns_an_associated_record_populated_with_the_Salesforce_attributes.yml +59 -59
  30. data/test/cassettes/Restforce_DB_Associations_HasOne/with_an_inverse_mapping/_build/when_no_salesforce_record_is_found_for_the_association/proceeds_without_constructing_any_records.yml +40 -40
  31. 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 +59 -59
  32. data/test/cassettes/Restforce_DB_Associations_HasOne/with_an_inverse_mapping/_build/when_the_associated_record_has_been_cached/uses_the_cached_record.yml +59 -59
  33. data/test/cassettes/Restforce_DB_Associations_HasOne/with_an_inverse_mapping/_build/when_the_association_is_non-building/proceeds_without_constructing_any_records.yml +50 -50
  34. data/test/cassettes/Restforce_DB_Associations_HasOne/with_an_inverse_mapping/_synced_for_/when_a_matching_associated_record_has_been_synchronized/returns_true.yml +59 -59
  35. data/test/cassettes/Restforce_DB_Associations_HasOne/with_an_inverse_mapping/_synced_for_/when_no_matching_associated_record_has_been_synchronized/returns_false.yml +59 -59
  36. 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 +103 -103
  37. 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 +112 -112
  38. data/test/cassettes/Restforce_DB_Cleaner/_run/given_a_synchronized_Salesforce_record/when_the_mapping_has_no_conditions/does_not_drop_the_synchronized_database_record.yml +23 -23
  39. data/test/cassettes/Restforce_DB_Cleaner/_run/given_a_synchronized_Salesforce_record/when_the_record_does_not_meet_the_mapping_conditions/but_meets_conditions_for_a_parallel_mapping/does_not_drop_the_synchronized_database_record.yml +43 -45
  40. 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 +41 -41
  41. data/test/cassettes/Restforce_DB_Cleaner/_run/given_a_synchronized_Salesforce_record/when_the_record_has_been_deleted_in_Salesforce/drops_the_synchronized_database_record.yml +20 -20
  42. data/test/cassettes/Restforce_DB_Cleaner/_run/given_a_synchronized_Salesforce_record/when_the_record_meets_the_mapping_conditions/does_not_drop_the_synchronized_database_record.yml +41 -41
  43. data/test/cassettes/Restforce_DB_Collector/_run/given_a_Salesforce_record_with_an_associated_database_record/returns_the_attributes_from_both_records.yml +41 -41
  44. data/test/cassettes/Restforce_DB_Collector/_run/given_an_existing_Salesforce_record/returns_the_attributes_from_the_Salesforce_record.yml +41 -41
  45. data/test/cassettes/Restforce_DB_Collector/_run/given_an_existing_database_record/returns_the_attributes_from_the_database_record.yml +15 -15
  46. data/test/cassettes/Restforce_DB_Initializer/_run/given_an_existing_Salesforce_record/for_a_Passive_strategy/does_not_create_a_database_record.yml +23 -23
  47. data/test/cassettes/Restforce_DB_Initializer/_run/given_an_existing_Salesforce_record/for_an_Always_strategy/creates_a_matching_database_record.yml +32 -33
  48. data/test/cassettes/Restforce_DB_Initializer/_run/given_an_existing_database_record/for_an_Always_strategy/populates_Salesforce_with_the_new_record.yml +59 -59
  49. data/test/cassettes/Restforce_DB_Instances_Salesforce/_synced_/when_a_matching_database_record_exists/returns_true.yml +32 -32
  50. data/test/cassettes/Restforce_DB_Instances_Salesforce/_synced_/when_no_matching_database_record_exists/returns_false.yml +32 -32
  51. data/test/cassettes/Restforce_DB_Instances_Salesforce/_update_/updates_the_local_record_with_the_passed_attributes.yml +49 -49
  52. data/test/cassettes/Restforce_DB_Instances_Salesforce/_update_/updates_the_record_in_Salesforce_with_the_passed_attributes.yml +58 -58
  53. data/test/cassettes/Restforce_DB_Instances_Salesforce/_updated_internally_/when_another_user_made_the_last_change/returns_false.yml +119 -0
  54. data/test/cassettes/Restforce_DB_Instances_Salesforce/_updated_internally_/when_our_client_made_the_last_change/returns_true.yml +158 -0
  55. data/test/cassettes/Restforce_DB_RecordTypes_Salesforce/_all/returns_a_list_of_the_existing_records_in_Salesforce.yml +32 -32
  56. data/test/cassettes/Restforce_DB_RecordTypes_Salesforce/_create_/creates_a_record_in_Salesforce_from_the_passed_database_record_s_attributes.yml +41 -41
  57. data/test/cassettes/Restforce_DB_RecordTypes_Salesforce/_create_/updates_the_database_record_with_the_Salesforce_record_s_ID.yml +41 -41
  58. data/test/cassettes/Restforce_DB_RecordTypes_Salesforce/_find/finds_existing_records_in_Salesforce.yml +32 -32
  59. data/test/cassettes/Restforce_DB_RecordTypes_Salesforce/_find/given_a_set_of_mapping_conditions/when_a_record_does_not_meet_the_conditions/does_not_find_the_record.yml +31 -31
  60. data/test/cassettes/Restforce_DB_RecordTypes_Salesforce/_find/given_a_set_of_mapping_conditions/when_a_record_meets_the_conditions/finds_the_record.yml +32 -32
  61. data/test/cassettes/Restforce_DB_RecordTypes_Salesforce/_find/returns_nil_when_no_matching_record_exists.yml +14 -14
  62. data/test/cassettes/Restforce_DB_Strategies_Always/_build_/given_a_Salesforce_record/wants_to_build_a_new_matching_record.yml +32 -32
  63. data/test/cassettes/Restforce_DB_Strategies_Always/_build_/given_a_Salesforce_record/with_a_corresponding_database_record/does_not_want_to_build_a_new_record.yml +32 -32
  64. data/test/cassettes/Restforce_DB_Strategies_Associated/_build_/given_an_inverse_mapping/with_a_synchronized_association_record/wants_to_build_a_new_record.yml +59 -59
  65. 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 +50 -50
  66. 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 +59 -59
  67. data/test/cassettes/Restforce_DB_Synchronizer/_run/given_a_Salesforce_record_with_an_associated_database_record/updates_the_database_record.yml +125 -49
  68. data/test/cassettes/Restforce_DB_Synchronizer/_run/given_a_Salesforce_record_with_an_associated_database_record/updates_the_salesforce_record.yml +58 -58
  69. data/test/cassettes/Restforce_DB_Synchronizer/_run/given_a_Salesforce_record_with_an_associated_database_record/when_the_change_timestamp_is_stale/does_not_update_the_database_record.yml +125 -36
  70. data/test/cassettes/Restforce_DB_Synchronizer/_run/given_a_Salesforce_record_with_an_associated_database_record/when_the_change_timestamp_is_stale/does_not_update_the_salesforce_record.yml +44 -44
  71. data/test/cassettes/Restforce_DB_Synchronizer/_run/given_a_Salesforce_record_with_an_associated_database_record/when_the_changes_are_current/updates_the_database_record.yml +323 -0
  72. data/test/cassettes/Restforce_DB_Synchronizer/_run/given_a_Salesforce_record_with_an_associated_database_record/when_the_changes_are_current/updates_the_salesforce_record.yml +286 -0
  73. data/test/cassettes/Restforce_DB_Synchronizer/_run/given_a_Salesforce_record_with_no_associated_database_record/does_nothing_for_this_specific_mapping.yml +41 -41
  74. data/test/lib/restforce/db/instances/active_record_test.rb +44 -0
  75. data/test/lib/restforce/db/instances/salesforce_test.rb +20 -0
  76. data/test/lib/restforce/db/synchronizer_test.rb +25 -13
  77. metadata +7 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c790174b7a31460e534bb254f1a624d5eaa3c0d0
4
- data.tar.gz: 500ff38107efb2fc41e18cea8c645b0e4fc4b2af
3
+ metadata.gz: 79cbb9803123677009dbab32fb024143cb03dd2c
4
+ data.tar.gz: 2c0e562e118e10b75d0fbc5b59192afbbc608260
5
5
  SHA512:
6
- metadata.gz: 88a7f335785b06227b32aedc9846b658f9e765fe69c26e48a33ca1e2f2915bc22f20f75f3a08c4bd9a93d99332091ce1b937e4bc5e936e90bbb46d17028dd512
7
- data.tar.gz: 63a32a184556cf24cd4f1565fe735d025d8390070280a8bccbf5d76fb4ac5d782bff272ffd2db9eebf251922dabe4b7e78e06bc1e5a474a99694d6e87bf0c00e
6
+ metadata.gz: 7cc36789670ad79e1c1ae4bd38a00ac98e078c447e3f5ee4c655666d1fb1ca644f5171172aadbd909eeb7514ce0efc121ab14e08a7d14cfb3e6649f54e4843b2
7
+ data.tar.gz: d635c8aeca64ea4ffd92943dc5291e9ff836d343fb70ff0457ea470e3dc2fd825408a5482c5fd7b32e4546ccae97dede8b3ec72bafb0193c59fd470589dbccce
@@ -74,7 +74,7 @@ module Restforce
74
74
  database_record.save!
75
75
  end
76
76
  rescue ActiveRecord::ActiveRecordError, Faraday::Error::ClientError => e
77
- DB.logger.error(e)
77
+ DB.logger.error(SynchronizationError.new(e, salesforce_instance))
78
78
  end
79
79
 
80
80
  # Internal: Get a Hash of associated lookup IDs for the passed database
@@ -43,7 +43,7 @@ module Restforce
43
43
  return unless @strategy.build?(instance)
44
44
  @mapping.database_record_type.create!(instance)
45
45
  rescue ActiveRecord::ActiveRecordError => e
46
- DB.logger.error(e)
46
+ DB.logger.error(SynchronizationError.new(e, instance))
47
47
  end
48
48
 
49
49
  # Internal: Attempt to create a partner record in Salesforce for the
@@ -57,7 +57,7 @@ module Restforce
57
57
  return if instance.synced?
58
58
  @mapping.salesforce_record_type.create!(instance)
59
59
  rescue Faraday::Error::ClientError => e
60
- DB.logger.error(e)
60
+ DB.logger.error(SynchronizationError.new(e, instance))
61
61
  end
62
62
 
63
63
  end
@@ -9,20 +9,15 @@ module Restforce
9
9
  # reconcile record attributes with Salesforce instances.
10
10
  class ActiveRecord < Base
11
11
 
12
- # Public: Get a common identifier for this record.
12
+ # Public: Get a common identifier for this record. If the record is
13
+ # unsynchronized, returns a database-specific identifier.
13
14
  #
14
15
  # Returns a String.
15
16
  def id
17
+ return "#{@record_type}::#{@record.id}" unless synced?
16
18
  @record.send(@mapping.lookup_column)
17
19
  end
18
20
 
19
- # Public: Has this record been synced to a Salesforce record?
20
- #
21
- # Returns a Boolean.
22
- def synced?
23
- @record.send(:"#{@mapping.lookup_column}?")
24
- end
25
-
26
21
  # Public: Get the time of the last update to this record.
27
22
  #
28
23
  # Returns a Time-compatible object.
@@ -38,6 +33,21 @@ module Restforce
38
33
  @record.synchronized_at
39
34
  end
40
35
 
36
+ # Public: Has this record been synced to a Salesforce record?
37
+ #
38
+ # Returns a Boolean.
39
+ def synced?
40
+ @record.send(:"#{@mapping.lookup_column}?")
41
+ end
42
+
43
+ # Public: Was this record most recently updated by Restforce::DB's
44
+ # workflow?
45
+ #
46
+ # Returns a Boolean.
47
+ def updated_internally?
48
+ last_synchronize.to_i >= last_update.to_i
49
+ end
50
+
41
51
  # Public: Bump the synchronization timestamp on the record.
42
52
  #
43
53
  # Returns nothing.
@@ -12,6 +12,7 @@ module Restforce
12
12
  INTERNAL_ATTRIBUTES = %w(
13
13
  Id
14
14
  SystemModstamp
15
+ LastModifiedById
15
16
  ).freeze
16
17
 
17
18
  # Public: Get a common identifier for this record.
@@ -53,6 +54,14 @@ module Restforce
53
54
  @mapping.database_model.exists?(@mapping.lookup_column => id)
54
55
  end
55
56
 
57
+ # Public: Was this record most recently updated by Restforce::DB's
58
+ # workflow?
59
+ #
60
+ # Returns a Boolean.
61
+ def updated_internally?
62
+ @record.LastModifiedById == DB.user_id
63
+ end
64
+
56
65
  end
57
66
 
58
67
  end
@@ -0,0 +1,40 @@
1
+ module Restforce
2
+
3
+ module DB
4
+
5
+ # Restforce::DB::SynchronizationError is a thin wrapper for any sort of
6
+ # exception that might crop up during our record synchronization. It exposes
7
+ # the Salesforce ID (or database identifier, for unsynced records) of the
8
+ # record which triggered the exception.
9
+ class SynchronizationError < RuntimeError
10
+
11
+ attr_reader :base_exception
12
+
13
+ extend Forwardable
14
+ def_delegators(
15
+ :base_exception,
16
+ :class,
17
+ :backtrace,
18
+ )
19
+
20
+ # Public: Initialize a new SynchronizationError.
21
+ #
22
+ # base_exception - An exception which should be logged.
23
+ # instance - A Restforce::DB::Instances::Base representing a record.
24
+ def initialize(base_exception, instance)
25
+ @base_exception = base_exception
26
+ @instance = instance
27
+ end
28
+
29
+ # Public: Get the message for this exception. Prepends the Salesforce ID.
30
+ #
31
+ # Returns a String.
32
+ def message
33
+ "[#{@instance.id}] #{base_exception.message}"
34
+ end
35
+
36
+ end
37
+
38
+ end
39
+
40
+ end
@@ -19,8 +19,8 @@ module Restforce
19
19
  # record descriptors to attributes.
20
20
  #
21
21
  # NOTE: Synchronizer assumes that the propagation step has done its job
22
- # correctly. If we can't locate a database record for a specific Salsforce
23
- # ID, we assume it shouldn't be synchronized.
22
+ # correctly. If we can't locate a database record for a specific
23
+ # Salesforce ID, we assume it shouldn't be synchronized.
24
24
  #
25
25
  # changes - A Hash, with keys composed of a Salesforce ID and model name,
26
26
  # with Restforce::DB::Accumulator objects as values.
@@ -32,13 +32,10 @@ module Restforce
32
32
 
33
33
  database_instance = @mapping.database_record_type.find(id)
34
34
  salesforce_instance = @mapping.salesforce_record_type.find(id)
35
- next unless database_instance && salesforce_instance
36
35
 
37
- most_recent_timestamp = [
38
- database_instance.last_update,
39
- salesforce_instance.last_update,
40
- ].max
41
- next unless accumulator.up_to_date_for?(most_recent_timestamp)
36
+ next unless database_instance && salesforce_instance
37
+ next unless up_to_date?(database_instance, accumulator)
38
+ next unless up_to_date?(salesforce_instance, accumulator)
42
39
 
43
40
  update(database_instance, accumulator)
44
41
  update(salesforce_instance, accumulator)
@@ -47,6 +44,15 @@ module Restforce
47
44
 
48
45
  private
49
46
 
47
+ # Internal: Is the passed instance up-to-date with the passed accumulator?
48
+ # Defaults to true if the most recent change to the instance was by the
49
+ # Restforce::DB worker.
50
+ #
51
+ # Returns a Boolean.
52
+ def up_to_date?(instance, accumulator)
53
+ instance.updated_internally? || accumulator.up_to_date_for?(instance.last_update)
54
+ end
55
+
50
56
  # Internal: Update the passed instance with the accumulated attributes
51
57
  # from a synchronization run.
52
58
  #
@@ -62,7 +68,7 @@ module Restforce
62
68
 
63
69
  instance.update!(attributes)
64
70
  rescue ActiveRecord::ActiveRecordError, Faraday::Error::ClientError => e
65
- DB.logger.error(e)
71
+ DB.logger.error(SynchronizationError.new(e, instance))
66
72
  end
67
73
 
68
74
  end
@@ -3,7 +3,7 @@ module Restforce
3
3
  # :nodoc:
4
4
  module DB
5
5
 
6
- VERSION = "2.2.2"
6
+ VERSION = "2.2.3"
7
7
 
8
8
  end
9
9
 
data/lib/restforce/db.rb CHANGED
@@ -9,6 +9,7 @@ require "restforce/db/configuration"
9
9
  require "restforce/db/registry"
10
10
  require "restforce/db/strategy"
11
11
  require "restforce/db/dsl"
12
+ require "restforce/db/synchronization_error"
12
13
 
13
14
  require "restforce/db/association_cache"
14
15
  require "restforce/db/associations/base"
@@ -91,6 +92,14 @@ module Restforce
91
92
  )
92
93
  end
93
94
 
95
+ # Public: Get the ID of the Salesforce user which is being used to access
96
+ # the Salesforce API.
97
+ #
98
+ # Returns a String.
99
+ def self.user_id
100
+ @user_id ||= client.user_info.user_id
101
+ end
102
+
94
103
  # Public: Configure Restforce::DB by assigning values to the current
95
104
  # configuration.
96
105
  #
@@ -21,10 +21,10 @@ http_interactions:
21
21
  message: OK
22
22
  headers:
23
23
  Date:
24
- - Fri, 10 Apr 2015 02:10:27 GMT
24
+ - Mon, 08 Jun 2015 22:12:32 GMT
25
25
  Set-Cookie:
26
- - BrowserId=FY9VBGWDTKOLnfn0YRc09A;Path=/;Domain=.salesforce.com;Expires=Tue,
27
- 09-Jun-2015 02:10:27 GMT
26
+ - BrowserId=Gpv2ju6aQEe8-0x8dK9RIw;Path=/;Domain=.salesforce.com;Expires=Fri,
27
+ 07-Aug-2015 22:12:32 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":"1428631827849","token_type":"Bearer","instance_url":"https://<host>","signature":"BXGR8ydlpCf8EvBey3owrmD+t8H2Xwv4wg5rPNZH7o0=","access_token":"00D1a000000H3O9!AQ4AQNe4R8V.LO2wVndhS1VuuxNtdXS1JCvyNPnzJvH6QSXO9uYDDviw_E1.9iDm2CAsI8PipNylFdpNxUnQrofmMfc7RNsW"}'
41
- http_version:
42
- recorded_at: Fri, 10 Apr 2015 02:10:29 GMT
40
+ string: '{"id":"https://login.salesforce.com/id/00D1a000000H3O9EAK/0051a000000UGT8AAO","issued_at":"1433801552514","token_type":"Bearer","instance_url":"https://<host>","signature":"jR8TwzE1K7eJmvEIAB/CwvmUpLO++wMy6JrY2U6ApRI=","access_token":"00D1a000000H3O9!AQ4AQH0rZGqBVji7vO4sB8J1_YW.g5S2vIbe9IaUgwHpwLPEdpfIcj9Ngpc2CndFvJZMwVIIp15.yQQOil19Qc2MuedbnlQz"}'
41
+ http_version:
42
+ recorded_at: Mon, 08 Jun 2015 22:12:34 GMT
43
43
  - request:
44
44
  method: post
45
45
  uri: https://<host>/services/data/<api_version>/sobjects/Contact
@@ -52,7 +52,7 @@ http_interactions:
52
52
  Content-Type:
53
53
  - application/json
54
54
  Authorization:
55
- - OAuth 00D1a000000H3O9!AQ4AQNe4R8V.LO2wVndhS1VuuxNtdXS1JCvyNPnzJvH6QSXO9uYDDviw_E1.9iDm2CAsI8PipNylFdpNxUnQrofmMfc7RNsW
55
+ - OAuth 00D1a000000H3O9!AQ4AQH0rZGqBVji7vO4sB8J1_YW.g5S2vIbe9IaUgwHpwLPEdpfIcj9Ngpc2CndFvJZMwVIIp15.yQQOil19Qc2MuedbnlQz
56
56
  Accept-Encoding:
57
57
  - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
58
58
  Accept:
@@ -63,38 +63,38 @@ http_interactions:
63
63
  message: Created
64
64
  headers:
65
65
  Date:
66
- - Fri, 10 Apr 2015 02:10:30 GMT
66
+ - Mon, 08 Jun 2015 22:12:32 GMT
67
67
  Set-Cookie:
68
- - BrowserId=6-GstZaCR1uEQGIPRQbjwA;Path=/;Domain=.salesforce.com;Expires=Tue,
69
- 09-Jun-2015 02:10:30 GMT
68
+ - BrowserId=37umUA-kQiyZa_VHsT17hg;Path=/;Domain=.salesforce.com;Expires=Fri,
69
+ 07-Aug-2015 22:12:32 GMT
70
70
  Expires:
71
71
  - Thu, 01 Jan 1970 00:00:00 GMT
72
72
  Sforce-Limit-Info:
73
- - api-usage=11/15000
73
+ - api-usage=10/15000
74
74
  Location:
75
- - "/services/data/<api_version>/sobjects/Contact/0031a000001y45eAAA"
75
+ - "/services/data/<api_version>/sobjects/Contact/0031a000004cfMoAAI"
76
76
  Content-Type:
77
77
  - application/json;charset=UTF-8
78
78
  Transfer-Encoding:
79
79
  - chunked
80
80
  body:
81
81
  encoding: ASCII-8BIT
82
- string: '{"id":"0031a000001y45eAAA","success":true,"errors":[]}'
83
- http_version:
84
- recorded_at: Fri, 10 Apr 2015 02:10:30 GMT
82
+ string: '{"id":"0031a000004cfMoAAI","success":true,"errors":[]}'
83
+ http_version:
84
+ recorded_at: Mon, 08 Jun 2015 22:12:34 GMT
85
85
  - request:
86
86
  method: post
87
87
  uri: https://<host>/services/data/<api_version>/sobjects/CustomObject__c
88
88
  body:
89
89
  encoding: UTF-8
90
- string: '{"Friend__c":"0031a000001y45eAAA"}'
90
+ string: '{"Friend__c":"0031a000004cfMoAAI"}'
91
91
  headers:
92
92
  User-Agent:
93
93
  - Faraday v0.9.1
94
94
  Content-Type:
95
95
  - application/json
96
96
  Authorization:
97
- - OAuth 00D1a000000H3O9!AQ4AQNe4R8V.LO2wVndhS1VuuxNtdXS1JCvyNPnzJvH6QSXO9uYDDviw_E1.9iDm2CAsI8PipNylFdpNxUnQrofmMfc7RNsW
97
+ - OAuth 00D1a000000H3O9!AQ4AQH0rZGqBVji7vO4sB8J1_YW.g5S2vIbe9IaUgwHpwLPEdpfIcj9Ngpc2CndFvJZMwVIIp15.yQQOil19Qc2MuedbnlQz
98
98
  Accept-Encoding:
99
99
  - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
100
100
  Accept:
@@ -105,28 +105,28 @@ http_interactions:
105
105
  message: Created
106
106
  headers:
107
107
  Date:
108
- - Fri, 10 Apr 2015 02:10:31 GMT
108
+ - Mon, 08 Jun 2015 22:12:32 GMT
109
109
  Set-Cookie:
110
- - BrowserId=ToZfBFxvREKP_xa5EJEGNg;Path=/;Domain=.salesforce.com;Expires=Tue,
111
- 09-Jun-2015 02:10:31 GMT
110
+ - BrowserId=aWkGvUiMT92OB8TG0j0OSA;Path=/;Domain=.salesforce.com;Expires=Fri,
111
+ 07-Aug-2015 22:12:32 GMT
112
112
  Expires:
113
113
  - Thu, 01 Jan 1970 00:00:00 GMT
114
114
  Sforce-Limit-Info:
115
- - api-usage=11/15000
115
+ - api-usage=12/15000
116
116
  Location:
117
- - "/services/data/<api_version>/sobjects/CustomObject__c/a001a000001LS2EAAW"
117
+ - "/services/data/<api_version>/sobjects/CustomObject__c/a001a000001cF5AAAU"
118
118
  Content-Type:
119
119
  - application/json;charset=UTF-8
120
120
  Transfer-Encoding:
121
121
  - chunked
122
122
  body:
123
123
  encoding: ASCII-8BIT
124
- string: '{"id":"a001a000001LS2EAAW","success":true,"errors":[]}'
125
- http_version:
126
- recorded_at: Fri, 10 Apr 2015 02:10:31 GMT
124
+ string: '{"id":"a001a000001cF5AAAU","success":true,"errors":[]}'
125
+ http_version:
126
+ recorded_at: Mon, 08 Jun 2015 22:12:34 GMT
127
127
  - request:
128
128
  method: get
129
- uri: https://<host>/services/data/<api_version>/query?q=select%20Id,%20SystemModstamp,%20Name,%20Example_Field__c,%20Friend__c%20from%20CustomObject__c%20where%20Id%20=%20%27a001a000001LS2EAAW%27
129
+ uri: https://<host>/services/data/<api_version>/query?q=select%20Id,%20SystemModstamp,%20LastModifiedById,%20Name,%20Example_Field__c,%20Friend__c%20from%20CustomObject__c%20where%20Id%20=%20%27a001a000001cF5AAAU%27
130
130
  body:
131
131
  encoding: US-ASCII
132
132
  string: ''
@@ -134,7 +134,7 @@ http_interactions:
134
134
  User-Agent:
135
135
  - Faraday v0.9.1
136
136
  Authorization:
137
- - OAuth 00D1a000000H3O9!AQ4AQNe4R8V.LO2wVndhS1VuuxNtdXS1JCvyNPnzJvH6QSXO9uYDDviw_E1.9iDm2CAsI8PipNylFdpNxUnQrofmMfc7RNsW
137
+ - OAuth 00D1a000000H3O9!AQ4AQH0rZGqBVji7vO4sB8J1_YW.g5S2vIbe9IaUgwHpwLPEdpfIcj9Ngpc2CndFvJZMwVIIp15.yQQOil19Qc2MuedbnlQz
138
138
  Accept-Encoding:
139
139
  - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
140
140
  Accept:
@@ -145,10 +145,10 @@ http_interactions:
145
145
  message: OK
146
146
  headers:
147
147
  Date:
148
- - Fri, 10 Apr 2015 02:10:32 GMT
148
+ - Mon, 08 Jun 2015 22:12:33 GMT
149
149
  Set-Cookie:
150
- - BrowserId=wSa0yGdqRY21w58q9qGeiw;Path=/;Domain=.salesforce.com;Expires=Tue,
151
- 09-Jun-2015 02:10:32 GMT
150
+ - BrowserId=JHHY4v-2SWitUxFQ0qr3iQ;Path=/;Domain=.salesforce.com;Expires=Fri,
151
+ 07-Aug-2015 22:12:33 GMT
152
152
  Expires:
153
153
  - Thu, 01 Jan 1970 00:00:00 GMT
154
154
  Sforce-Limit-Info:
@@ -159,12 +159,12 @@ http_interactions:
159
159
  - chunked
160
160
  body:
161
161
  encoding: ASCII-8BIT
162
- string: '{"totalSize":1,"done":true,"records":[{"attributes":{"type":"CustomObject__c","url":"/services/data/<api_version>/sobjects/CustomObject__c/a001a000001LS2EAAW"},"Id":"a001a000001LS2EAAW","SystemModstamp":"2015-04-10T02:10:31.000+0000","Name":"a001a000001LS2E","Example_Field__c":null,"Friend__c":"0031a000001y45eAAA"}]}'
163
- http_version:
164
- recorded_at: Fri, 10 Apr 2015 02:10:32 GMT
162
+ string: '{"totalSize":1,"done":true,"records":[{"attributes":{"type":"CustomObject__c","url":"/services/data/<api_version>/sobjects/CustomObject__c/a001a000001cF5AAAU"},"Id":"a001a000001cF5AAAU","SystemModstamp":"2015-06-08T22:12:32.000+0000","LastModifiedById":"0051a000000UGT8AAO","Name":"a001a000001cF5A","Example_Field__c":null,"Friend__c":"0031a000004cfMoAAI"}]}'
163
+ http_version:
164
+ recorded_at: Mon, 08 Jun 2015 22:12:34 GMT
165
165
  - request:
166
166
  method: get
167
- uri: https://<host>/services/data/<api_version>/query?q=select%20Id,%20SystemModstamp,%20Email%20from%20Contact%20where%20Id%20=%20%270031a000001y45eAAA%27
167
+ uri: https://<host>/services/data/<api_version>/query?q=select%20Id,%20SystemModstamp,%20LastModifiedById,%20Email%20from%20Contact%20where%20Id%20=%20%270031a000004cfMoAAI%27
168
168
  body:
169
169
  encoding: US-ASCII
170
170
  string: ''
@@ -172,7 +172,7 @@ http_interactions:
172
172
  User-Agent:
173
173
  - Faraday v0.9.1
174
174
  Authorization:
175
- - OAuth 00D1a000000H3O9!AQ4AQNe4R8V.LO2wVndhS1VuuxNtdXS1JCvyNPnzJvH6QSXO9uYDDviw_E1.9iDm2CAsI8PipNylFdpNxUnQrofmMfc7RNsW
175
+ - OAuth 00D1a000000H3O9!AQ4AQH0rZGqBVji7vO4sB8J1_YW.g5S2vIbe9IaUgwHpwLPEdpfIcj9Ngpc2CndFvJZMwVIIp15.yQQOil19Qc2MuedbnlQz
176
176
  Accept-Encoding:
177
177
  - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
178
178
  Accept:
@@ -183,10 +183,10 @@ http_interactions:
183
183
  message: OK
184
184
  headers:
185
185
  Date:
186
- - Fri, 10 Apr 2015 02:10:33 GMT
186
+ - Mon, 08 Jun 2015 22:12:33 GMT
187
187
  Set-Cookie:
188
- - BrowserId=wJyFDAF4T3i6yXDBP6z6Jw;Path=/;Domain=.salesforce.com;Expires=Tue,
189
- 09-Jun-2015 02:10:33 GMT
188
+ - BrowserId=d_bPQ3W6QqSAIplgGXlcGA;Path=/;Domain=.salesforce.com;Expires=Fri,
189
+ 07-Aug-2015 22:12:33 GMT
190
190
  Expires:
191
191
  - Thu, 01 Jan 1970 00:00:00 GMT
192
192
  Sforce-Limit-Info:
@@ -197,12 +197,12 @@ http_interactions:
197
197
  - chunked
198
198
  body:
199
199
  encoding: ASCII-8BIT
200
- string: '{"totalSize":1,"done":true,"records":[{"attributes":{"type":"Contact","url":"/services/data/<api_version>/sobjects/Contact/0031a000001y45eAAA"},"Id":"0031a000001y45eAAA","SystemModstamp":"2015-04-10T02:10:30.000+0000","Email":"somebody@example.com"}]}'
201
- http_version:
202
- recorded_at: Fri, 10 Apr 2015 02:10:33 GMT
200
+ string: '{"totalSize":1,"done":true,"records":[{"attributes":{"type":"Contact","url":"/services/data/<api_version>/sobjects/Contact/0031a000004cfMoAAI"},"Id":"0031a000004cfMoAAI","SystemModstamp":"2015-06-08T22:12:32.000+0000","LastModifiedById":"0051a000000UGT8AAO","Email":"somebody@example.com"}]}'
201
+ http_version:
202
+ recorded_at: Mon, 08 Jun 2015 22:12:34 GMT
203
203
  - request:
204
204
  method: delete
205
- uri: https://<host>/services/data/<api_version>/sobjects/Contact/0031a000001y45eAAA
205
+ uri: https://<host>/services/data/<api_version>/sobjects/Contact/0031a000004cfMoAAI
206
206
  body:
207
207
  encoding: US-ASCII
208
208
  string: ''
@@ -210,7 +210,7 @@ http_interactions:
210
210
  User-Agent:
211
211
  - Faraday v0.9.1
212
212
  Authorization:
213
- - OAuth 00D1a000000H3O9!AQ4AQNe4R8V.LO2wVndhS1VuuxNtdXS1JCvyNPnzJvH6QSXO9uYDDviw_E1.9iDm2CAsI8PipNylFdpNxUnQrofmMfc7RNsW
213
+ - OAuth 00D1a000000H3O9!AQ4AQH0rZGqBVji7vO4sB8J1_YW.g5S2vIbe9IaUgwHpwLPEdpfIcj9Ngpc2CndFvJZMwVIIp15.yQQOil19Qc2MuedbnlQz
214
214
  Accept-Encoding:
215
215
  - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
216
216
  Accept:
@@ -221,10 +221,10 @@ http_interactions:
221
221
  message: No Content
222
222
  headers:
223
223
  Date:
224
- - Fri, 10 Apr 2015 02:10:34 GMT
224
+ - Mon, 08 Jun 2015 22:12:33 GMT
225
225
  Set-Cookie:
226
- - BrowserId=oky5yaNtQlSK9UVhJpAnvQ;Path=/;Domain=.salesforce.com;Expires=Tue,
227
- 09-Jun-2015 02:10:34 GMT
226
+ - BrowserId=w_dEnJnWQ76qT74cRj4chw;Path=/;Domain=.salesforce.com;Expires=Fri,
227
+ 07-Aug-2015 22:12:33 GMT
228
228
  Expires:
229
229
  - Thu, 01 Jan 1970 00:00:00 GMT
230
230
  Sforce-Limit-Info:
@@ -232,11 +232,11 @@ http_interactions:
232
232
  body:
233
233
  encoding: UTF-8
234
234
  string: ''
235
- http_version:
236
- recorded_at: Fri, 10 Apr 2015 02:10:34 GMT
235
+ http_version:
236
+ recorded_at: Mon, 08 Jun 2015 22:12:35 GMT
237
237
  - request:
238
238
  method: delete
239
- uri: https://<host>/services/data/<api_version>/sobjects/CustomObject__c/a001a000001LS2EAAW
239
+ uri: https://<host>/services/data/<api_version>/sobjects/CustomObject__c/a001a000001cF5AAAU
240
240
  body:
241
241
  encoding: US-ASCII
242
242
  string: ''
@@ -244,7 +244,7 @@ http_interactions:
244
244
  User-Agent:
245
245
  - Faraday v0.9.1
246
246
  Authorization:
247
- - OAuth 00D1a000000H3O9!AQ4AQNe4R8V.LO2wVndhS1VuuxNtdXS1JCvyNPnzJvH6QSXO9uYDDviw_E1.9iDm2CAsI8PipNylFdpNxUnQrofmMfc7RNsW
247
+ - OAuth 00D1a000000H3O9!AQ4AQH0rZGqBVji7vO4sB8J1_YW.g5S2vIbe9IaUgwHpwLPEdpfIcj9Ngpc2CndFvJZMwVIIp15.yQQOil19Qc2MuedbnlQz
248
248
  Accept-Encoding:
249
249
  - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
250
250
  Accept:
@@ -255,10 +255,10 @@ http_interactions:
255
255
  message: No Content
256
256
  headers:
257
257
  Date:
258
- - Fri, 10 Apr 2015 02:10:35 GMT
258
+ - Mon, 08 Jun 2015 22:12:33 GMT
259
259
  Set-Cookie:
260
- - BrowserId=zymXJDyvSpGTuUi-0iLM_Q;Path=/;Domain=.salesforce.com;Expires=Tue,
261
- 09-Jun-2015 02:10:35 GMT
260
+ - BrowserId=zxjQmM5tRriwTIKOZVY98Q;Path=/;Domain=.salesforce.com;Expires=Fri,
261
+ 07-Aug-2015 22:12:33 GMT
262
262
  Expires:
263
263
  - Thu, 01 Jan 1970 00:00:00 GMT
264
264
  Sforce-Limit-Info:
@@ -266,6 +266,6 @@ http_interactions:
266
266
  body:
267
267
  encoding: UTF-8
268
268
  string: ''
269
- http_version:
270
- recorded_at: Fri, 10 Apr 2015 02:10:35 GMT
269
+ http_version:
270
+ recorded_at: Mon, 08 Jun 2015 22:12:35 GMT
271
271
  recorded_with: VCR 2.9.3