From ed196cc47c4e1556bc2a6f30e915661660eaf6c6 Mon Sep 17 00:00:00 2001 From: r888888888 Date: Mon, 22 Aug 2016 13:51:25 -0700 Subject: [PATCH] compatibility with postgres 9.4 --- app/models/post_update.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/models/post_update.rb b/app/models/post_update.rb index 13aa4a290..46c89c5ff 100644 --- a/app/models/post_update.rb +++ b/app/models/post_update.rb @@ -1,6 +1,7 @@ class PostUpdate def self.insert(post_id) - ActiveRecord::Base.execute_sql("insert into post_updates (post_id) values (?) on conflict do nothing", post_id) + ActiveRecord::Base.execute_sql("insert into post_updates (post_id) values (?)", post_id) + rescue ActiveRecord::RecordNotUnique end def self.get