Skip to content

A platform for community discussion. Free, open, simple.

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

Guo Xiang Tan7da7a30e0226
diff --git a/app/models/post_mover.rb b/app/models/post_mover.rb
index 99ee4b1ebf2..d8db5c6c5e8 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