PERF: Restore exists? in favor of blank?.

Regression from dcd7b92532.
This commit is contained in:
Guo Xiang Tan 2019-02-18 09:59:50 +08:00
parent 24369a8166
commit 7da7a30e02

View File

@ -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