Class: UdSync::Sentinel
- Inherits:
-
Object
- Object
- UdSync::Sentinel
- Defined in:
- lib/ud_sync/sentinel.rb
Instance Method Summary collapse
-
#initialize(model, options) ⇒ Sentinel
constructor
A new instance of Sentinel.
- #save_operation ⇒ Object
Constructor Details
#initialize(model, options) ⇒ Sentinel
Returns a new instance of Sentinel.
4 5 6 7 |
# File 'lib/ud_sync/sentinel.rb', line 4 def initialize(model, ) @model = model @options = end |
Instance Method Details
#save_operation ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/ud_sync/sentinel.rb', line 9 def save_operation operation = if model.destroyed? :delete else :save end UdSync::Operation.create( name: operation, record_id: model.id, external_id: external_id, owner_id: owner_id, entity_name: operation_name ) end |