Keep track of who deletes forum post/topic/comment
Previously it would look like the creator of it was the one who deleted/undeleted it, even if it was someone else.
This commit is contained in:
@@ -51,7 +51,7 @@ class ForumTopicsController < ApplicationController
|
||||
def destroy
|
||||
@forum_topic = ForumTopic.find(params[:id])
|
||||
check_privilege(@forum_topic)
|
||||
@forum_topic.update_column(:is_deleted, true)
|
||||
@forum_topic.delete!
|
||||
flash[:notice] = "Topic deleted"
|
||||
respond_with(@forum_topic)
|
||||
end
|
||||
@@ -59,7 +59,7 @@ class ForumTopicsController < ApplicationController
|
||||
def undelete
|
||||
@forum_topic = ForumTopic.find(params[:id])
|
||||
check_privilege(@forum_topic)
|
||||
@forum_topic.update_column(:is_deleted, false)
|
||||
@forum_topic.undelete!
|
||||
flash[:notice] = "Topic undeleted"
|
||||
respond_with(@forum_topic)
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user