FIX: Posts in a deleted topic couldn't be moved.

https://meta.discourse.org/t/moving-posts-to-new-topic/58436/4
This commit is contained in:
Guo Xiang Tan
2017-03-06 14:55:58 +08:00
parent a28704bcee
commit 477eb0591e
2 changed files with 40 additions and 10 deletions

View File

@ -497,7 +497,7 @@ class TopicsController < ApplicationController
params.require(:topic_id)
params.permit(:category_id)
topic = Topic.find_by(id: params[:topic_id])
topic = Topic.with_deleted.find_by(id: params[:topic_id])
guardian.ensure_can_move_posts!(topic)
dest_topic = move_posts_to_destination(topic)