mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
Refactor select().map() to use pluck.
Remove a method already provided by ActiveRecord.
This commit is contained in:
committed by
Avdi Grimm
parent
d30330441a
commit
5659b66729
@@ -43,7 +43,7 @@ class PostDestroyer
|
||||
@post.update_flagged_posts_count
|
||||
|
||||
# Remove any reply records that point to deleted posts
|
||||
post_ids = PostReply.select(:post_id).where(reply_id: @post.id).map(&:post_id)
|
||||
post_ids = PostReply.where(reply_id: @post.id).pluck(:post_id)
|
||||
PostReply.delete_all reply_id: @post.id
|
||||
|
||||
if post_ids.present?
|
||||
|
||||
Reference in New Issue
Block a user