just checking for existence is enough here

This commit is contained in:
Régis Hanol 2016-11-30 23:41:07 +01:00
parent 28b7ef7142
commit 453d149182

View File

@ -163,7 +163,7 @@ SQL
added_urls << url 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 begin
TopicLink.create!(post_id: post.id, TopicLink.create!(post_id: post.id,
user_id: post.user_id, user_id: post.user_id,