Class: Restforce::DB::Attacher
- Defined in:
- lib/restforce/db/attacher.rb
Overview
Restforce::DB::Attacher is responsible for cleaning up any orphaned upserted Salesforce records with the database records that they were originally supposed to be attached to. This allows us to successfully handle cases where a request timeout or partial failure would otherwise leave an upserted Salesforce record stranded without a related database record.
Instance Method Summary collapse
-
#run(*_) ⇒ Object
Public: Run the re-attachment process for any unsynchronized Salesforce records which have an external upsert ID.
Methods inherited from Task
Constructor Details
This class inherits a constructor from Restforce::DB::Task
Instance Method Details
#run(*_) ⇒ Object
Public: Run the re-attachment process for any unsynchronized Salesforce records which have an external upsert ID.
Returns nothing.
17 18 19 20 21 22 23 |
# File 'lib/restforce/db/attacher.rb', line 17 def run(*_) return if @mapping.strategy.passive? @runner.run(@mapping) do |run| run.salesforce_instances.each { |instance| attach(instance) } end end |