Class: Restforce::DB::Strategies::Always

Inherits:
Object
  • Object
show all
Defined in:
lib/restforce/db/strategies/always.rb

Overview

Restforce::DB::Strategies::Always defines an initialization strategy for a mapping in which newly-discovered records should always be synchronized from Salesforce into the database, and vice-versa.

Instance Method Summary collapse

Constructor Details

#initialize(**_) ⇒ Always

Public: Initialize a Restforce::DB::Strategies::Always.



13
14
# File 'lib/restforce/db/strategies/always.rb', line 13

def initialize(**_)
end

Instance Method Details

#build?(record) ⇒ Boolean

Public: Should the passed record be constructed in the other system?

record - A Restforce::DB::Instances::Base.

Returns a Boolean.

Returns:

  • (Boolean)


21
22
23
# File 'lib/restforce/db/strategies/always.rb', line 21

def build?(record)
  !record.synced?
end

#passive?Boolean

Public: Is this a passive sync strategy?

Returns false.

Returns:

  • (Boolean)


28
29
30
# File 'lib/restforce/db/strategies/always.rb', line 28

def passive?
  false
end