Can recover deleted topics. Deleted topics show the first post as deleted in the UI.

This commit is contained in:
Robin Ward
2013-07-12 12:08:23 -04:00
parent f05bc44fbe
commit 6ca5df0a09
16 changed files with 167 additions and 31 deletions

View File

@ -9,6 +9,7 @@ class TopicsController < ApplicationController
:update,
:star,
:destroy,
:recover,
:status,
:invite,
:mute,
@ -175,6 +176,13 @@ class TopicsController < ApplicationController
render nothing: true
end
def recover
topic = Topic.where(id: params[:topic_id]).with_deleted.first
guardian.ensure_can_recover_topic!(topic)
topic.recover!
render nothing: true
end
def excerpt
render nothing: true
end