lib/mvp/forge.rb
# transform dates into a format that bigquery knows
transform dates into a format that bigquery knows
transform dates into a format that bigquery knows
def munge_dates(object)
      ["created_at", "updated_at", "deprecated_at", "deleted_at"].each do |field|
        next unless object.first.keys.include? field
        object.each do |record|
          next unless record[field]
          record[field] = DateTime.parse(record[field]).strftime("%Y-%m-%d %H:%M:%S")
        end
      end
      object
    end
def munge_dates ( object ) [ "created_at" , "updated_at" , "deprecated_at" , "deleted_at" ] . each do | field | next unless object . first . keys . include? field object . each do | record | next unless record [ field ] record [ field ] = DateTime . parse ( record [ field ] ) . strftime ( "%Y-%m-%d %H:%M:%S" ) end end object end
transform dates into a format that bigquery knows
transform dates into a format that bigquery knows
object