Method: Webhookdb::Replicator::Column#defaulter

Defined in:
lib/webhookdb/replicator/column.rb

#defaulterIsomorphicProc (readonly)

If the value we retrieve from the data provided by the external service is nil, we often want to use a default value instead of nil. The ‘defaulter` is an `IsomorphicProc` where both procs take the resource object and return a default value that is used in the upsert. A common example is the `now` defaulter, which uses the current time as the default value.

Returns:

  • (IsomorphicProc)

    The ‘ruby’ proc accepts (resource:, event:, enrichment:, service_integration:) and returns a value. The ‘sql’ proc accepts (service_integration:) and returns an sql expression.



337
338
339
# File 'lib/webhookdb/replicator/column.rb', line 337

def defaulter
  @defaulter
end