From 0d66529d2bcfd4d1cf9bd24a7b531dfe87cfff36 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9gis=20Hanol?= Date: Mon, 24 Apr 2017 23:14:01 +0200 Subject: [PATCH] PostReply doesn't have a primary key, so no luck here --- app/models/post_mover.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/post_mover.rb b/app/models/post_mover.rb index 6eb40b6d01b..9dff1988fb4 100644 --- a/app/models/post_mover.rb +++ b/app/models/post_mover.rb @@ -77,7 +77,7 @@ class PostMover post.is_first_post? ? create_first_post(post) : move(post) end - PostReply.where("reply_id in (:post_ids) OR post_id in (:post_ids)", post_ids: post_ids).find_each do |post_reply| + PostReply.where("reply_id IN (:post_ids) OR post_id IN (:post_ids)", post_ids: post_ids).each do |post_reply| if post_reply.post && post_reply.reply && post_reply.reply.topic_id != post_reply.post.topic_id PostReply.delete_all(reply_id: post_reply.reply.id, post_id: post_reply.post.id) end