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 +4 -4
- data/README.md +2 -0
- data/lib/salesforce_ar_sync/salesforce_sync.rb +6 -7
- data/lib/salesforce_ar_sync/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 469e85715a39bc27f3ce3af76aa9178d9c1abf4c2ec7239efbf842dc6ad71d71
|
4
|
+
data.tar.gz: 7e9f9732581785b7242392aab88a0078d58d791d96836f3377745428cae0a91e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
228
|
-
salesforce_create_object(
|
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
|
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.
|
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-
|
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
|