From 307845d72acccc522f5189067ee422fc2615acd4 Mon Sep 17 00:00:00 2001 From: Uri Mikhli Date: Wed, 13 Apr 2016 21:56:35 -0400 Subject: [PATCH] give credit for idea...https://github.com/seamusabshere/upsert/pull/65 --- lib/upsert/merge_function/postgresql.rb | 1 + 1 file changed, 1 insertion(+) 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()"