PERF: Restore `exists?` in favor of `blank?`.

PERF: Restore exists? in favor of blank?.

Regression from dcd7b925327ac3523ccbf94216e43f3f6b56df52.

diff --git a/app/models/post_mover.rb b/app/models/post_mover.rb
index 99ee4b1..d8db5c6 100644
--- a/app/models/post_mover.rb
+++ b/app/models/post_mover.rb
@@ -87,7 +87,8 @@ class PostMover
 
     posts.each do |post|
       post.is_first_post? ? create_first_post(post) : move(post)
-      if @move_to_pm && destination_topic.topic_allowed_users.where(user_id: post.user_id).blank?
+
+      if @move_to_pm && !destination_topic.topic_allowed_users.exists?(user_id: post.user_id)
         destination_topic.topic_allowed_users.create!(user_id: post.user_id)
       end
     end

GitHub sha: 7da7a30e

3 Likes