FIX: Ensure that we only move posts that belong to the original topic.

This commit is contained in:
Guo Xiang Tan
2017-03-06 15:04:10 +08:00
parent b2cfad5f47
commit 8aea3caf00
2 changed files with 21 additions and 4 deletions

View File

@@ -157,7 +157,7 @@ class PostMover
def posts
@posts ||= begin
Post.where(id: post_ids).order(:created_at).tap do |posts|
Post.where(topic: @original_topic, id: post_ids).order(:created_at).tap do |posts|
raise Discourse::InvalidParameters.new(:post_ids) if posts.empty?
end
end