diff --git a/lib/upsert/merge_function/postgresql.rb b/lib/upsert/merge_function/postgresql.rb index af932ec..2441ea5 100644 --- a/lib/upsert/merge_function/postgresql.rb +++ b/lib/upsert/merge_function/postgresql.rb @@ -109,6 +109,7 @@ def create! names = setter_column_definitions.map(&:quoted_name).join(', ') values = setter_column_definitions.map(&:to_setter_value).join(', ') update_pair = update_column_definitions.map(&:to_setter).join(', ') + #Solution based on based on https://github.com/seamusabshere/upsert/pull/65 if @time_stamp_cols.count > 0 names += ', created_at, updated_at' values += ", now(), now()"