From 453d1491827e34500488f8cb704dd8ed5f9e4acb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9gis=20Hanol?= Date: Wed, 30 Nov 2016 23:41:07 +0100 Subject: [PATCH] just checking for existence is enough here --- app/models/topic_link.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/topic_link.rb b/app/models/topic_link.rb index ddeac934d70..12ae7dcaab0 100644 --- a/app/models/topic_link.rb +++ b/app/models/topic_link.rb @@ -163,7 +163,7 @@ SQL added_urls << url - unless TopicLink.find_by(topic_id: post.topic_id, post_id: post.id, url: url) + unless TopicLink.exists?(topic_id: post.topic_id, post_id: post.id, url: url) begin TopicLink.create!(post_id: post.id, user_id: post.user_id,