salesforce_ar_sync 5.2.0 → 5.3.0

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5a366e664f19f09c3ad3f31088f75d90e4d11ba5b2708d59a5a8e470ebc0276c
4
- data.tar.gz: 2f37638a57e5769698051c8cbbdcaa49dce50de4eae90d12da6a59dabc5b0765
3
+ metadata.gz: 469e85715a39bc27f3ce3af76aa9178d9c1abf4c2ec7239efbf842dc6ad71d71
4
+ data.tar.gz: 7e9f9732581785b7242392aab88a0078d58d791d96836f3377745428cae0a91e
5
5
  SHA512:
6
- metadata.gz: 401722023c03c42c8dd070a8259dd0e5ddeec6306414ebd6d66d23de4055857a5fac177943d61bc8f81e2e5be508295c5cd22673e9a7be1adcd1e66adcdf1fad
7
- data.tar.gz: 60529516c0d6350377dd7f9b229cd6642a6025dc9c72bf107331dd323232fa8526453b7c727a8dd57de754576f1687e1f72f7790643dcdeab43772148614659a
6
+ metadata.gz: eee86f8fe5a96e0f58349863cdad1ee9ac385175658c8e090c9acee8d005c5de2fb18d37b91929f4373cec34baf25ddd0306415d667e310fc98cab9538fd49d5
7
+ data.tar.gz: 97e2f7b8bd5eb49342b49d100b23de407feb95b8262ce8c8695488abf369d8150e70cd889acf62fda6c4e0792fcec68061cd48498b764999252ec3fbb34c77b0
data/README.md CHANGED
@@ -327,6 +327,8 @@ configuration variable _SALESFORCE_AR_SYNC_CONFIG["SYNC_ENABLED"]_
327
327
 
328
328
  You can trigger a manual sync of any configured attributes. All checks to skip syncing or to sync asynchronously will still be executed.
329
329
 
330
+ If the record does not exist in Salesforce, the provided attributes will be ignored and all attributes will be synced.
331
+
330
332
  ```ruby
331
333
  my_user_record.salesforce_sync(:email)
332
334
 
@@ -176,20 +176,19 @@ module SalesforceArSync
176
176
 
177
177
  def salesforce_create_object(attributes)
178
178
  attributes[self.class.salesforce_web_id_attribute_name.to_s] = id if self.class.salesforce_sync_web_id? && !new_record?
179
- salesforce_id = SF_CLIENT.create(salesforce_object_name, format_attributes(attributes))
180
- self.salesforce_id = salesforce_id
179
+ self.salesforce_id = SF_CLIENT.create!(salesforce_object_name, format_attributes(attributes))
181
180
  @exists_in_salesforce = true
182
181
  end
183
182
 
184
183
  def salesforce_update_object(attributes)
185
184
  attributes[self.class.salesforce_web_id_attribute_name.to_s] = id if self.class.salesforce_sync_web_id? && !new_record?
186
185
 
187
- SF_CLIENT.update(salesforce_object_name, format_attributes(attributes).merge(Id: salesforce_id))
186
+ SF_CLIENT.update!(salesforce_object_name, format_attributes(attributes).merge(Id: salesforce_id))
188
187
  end
189
188
 
190
189
  def salesforce_delete_object
191
190
  if ar_sync_outbound_delete?
192
- SF_CLIENT.destroy(salesforce_object_name, salesforce_id)
191
+ SF_CLIENT.destroy!(salesforce_object_name, salesforce_id)
193
192
  end
194
193
  end
195
194
 
@@ -224,8 +223,8 @@ module SalesforceArSync
224
223
  else
225
224
  if salesforce_object_exists?
226
225
  salesforce_update_object(attributes_to_update) if attributes_to_update.present?
227
- else
228
- salesforce_create_object(attributes_to_update(!new_record?)) if salesforce_id.nil?
226
+ elsif salesforce_id.nil?
227
+ salesforce_create_object(salesforce_attributes_to_update(!new_record?))
229
228
  end
230
229
  end
231
230
  rescue Exception => ex
@@ -236,7 +235,7 @@ module SalesforceArSync
236
235
  def sync_web_id
237
236
  return false if !self.class.salesforce_sync_web_id? || SalesforceArSync.config['SYNC_ENABLED'] == false
238
237
 
239
- SF_CLIENT.update(salesforce_object_name, Id: salesforce_id, self.class.salesforce_web_id_attribute_name.to_s => get_activerecord_web_id) if salesforce_id
238
+ SF_CLIENT.update!(salesforce_object_name, Id: salesforce_id, self.class.salesforce_web_id_attribute_name.to_s => get_activerecord_web_id) if salesforce_id
240
239
  end
241
240
 
242
241
  def get_activerecord_web_id
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module SalesforceArSync
4
- VERSION = '5.2.0'
4
+ VERSION = '5.3.0'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: salesforce_ar_sync
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.2.0
4
+ version: 5.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Halliday
@@ -12,7 +12,7 @@ authors:
12
12
  autorequire:
13
13
  bindir: bin
14
14
  cert_chain: []
15
- date: 2025-07-15 00:00:00.000000000 Z
15
+ date: 2025-09-23 00:00:00.000000000 Z
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency
18
18
  name: actionpack-xml_parser