Method: Webhooker::Model#_trigger_webhook_on_update

Defined in:
lib/webhooker/model.rb

#_trigger_webhook_on_updateObject



12
13
14
15
16
17
18
19
20
21
22
# File 'lib/webhooker/model.rb', line 12

def _trigger_webhook_on_update
  filtered_changes =
    if self.class.webhook_attributes
      changes.slice(*self.class.webhook_attributes)
    else
      changes
    end
  if filtered_changes.present?
    _trigger_webhook :update, changes: filtered_changes.as_json
  end
end