Class: SalesforceArSync::SalesforceObjectSync
- Inherits:
-
Struct
- Object
- Struct
- SalesforceArSync::SalesforceObjectSync
- Defined in:
- lib/salesforce_ar_sync/salesforce_object_sync.rb
Overview
simple object to be serialized when asynchronously sending data to Salesforce
Instance Attribute Summary collapse
-
#attributes ⇒ Object
Returns the value of attribute attributes.
-
#salesforce_id ⇒ Object
Returns the value of attribute salesforce_id.
-
#web_object_name ⇒ Object
Returns the value of attribute web_object_name.
Instance Method Summary collapse
Instance Attribute Details
#attributes ⇒ Object
Returns the value of attribute attributes
3 4 5 |
# File 'lib/salesforce_ar_sync/salesforce_object_sync.rb', line 3 def attributes @attributes end |
#salesforce_id ⇒ Object
Returns the value of attribute salesforce_id
3 4 5 |
# File 'lib/salesforce_ar_sync/salesforce_object_sync.rb', line 3 def salesforce_id @salesforce_id end |
#web_object_name ⇒ Object
Returns the value of attribute web_object_name
3 4 5 |
# File 'lib/salesforce_ar_sync/salesforce_object_sync.rb', line 3 def web_object_name @web_object_name end |
Instance Method Details
#perform ⇒ Object
4 5 6 7 8 9 10 11 |
# File 'lib/salesforce_ar_sync/salesforce_object_sync.rb', line 4 def perform web_object = "#{web_object_name}".constantize.find_by_salesforce_id salesforce_id #object exists in salesforce if we call its system_mod_stamp if (system_mod_stamp = web_object.system_mod_stamp) web_object.salesforce_update_object(web_object.salesforce_attributes_to_update(true)) web_object.update_attribute(:salesforce_updated_at, system_mod_stamp) end end |