From 59db60f35c102aa3db42eaf27ddc6a573e3ab69e Mon Sep 17 00:00:00 2001 From: Toks Date: Sat, 29 Jun 2013 11:44:33 -0400 Subject: [PATCH] fixes #1815 --- app/controllers/moderator/post/posts_controller.rb | 2 +- app/models/post.rb | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/app/controllers/moderator/post/posts_controller.rb b/app/controllers/moderator/post/posts_controller.rb index 0aa862959..67b4cb30a 100644 --- a/app/controllers/moderator/post/posts_controller.rb +++ b/app/controllers/moderator/post/posts_controller.rb @@ -13,7 +13,7 @@ module Moderator @post = ::Post.find(params[:id]) if params[:commit] == "Delete" @post.flag!(params[:reason]) - @post.delete! + @post.delete!(:reason => params[:reason]) end redirect_to(post_path(@post)) end diff --git a/app/models/post.rb b/app/models/post.rb index 6dea2b31d..d84def7b1 100644 --- a/app/models/post.rb +++ b/app/models/post.rb @@ -875,7 +875,11 @@ class Post < ActiveRecord::Base update_column(:is_banned, true) if options[:ban] || has_tag?("banned_artist") unless options[:without_mod_action] - ModAction.create(:description => "deleted post ##{id}") + if options[:reason] + ModAction.create(:description => "deleted post ##{id}, reason: #{options[:reason]}") + else + ModAction.create(:description => "deleted post ##{id}") + end end end end