Method: Dataflow::Nodes::Mixin::AddInternalTimestamp#add_internal_timestamp

Defined in:
lib/dataflow/nodes/mixin/add_internal_timestamp.rb

#add_internal_timestamp(records:) ⇒ Object

Add an internal updated_at timestamp to the records


15
16
17
18
19
20
21
22
23
# File 'lib/dataflow/nodes/mixin/add_internal_timestamp.rb', line 15

def add_internal_timestamp(records:)
  return unless use_internal_timestamp
  return unless internal_timestamp_key.present?

  updated_at = Time.now
  records.each do |record|
    record[internal_timestamp_key] = updated_at
  end
end