Add category for mod actions

This commit is contained in:
BrokenEagle
2018-01-13 14:48:08 -08:00
parent b9964e97a7
commit 3c45273694
18 changed files with 92 additions and 32 deletions

View File

@@ -1371,7 +1371,7 @@ class Post < ApplicationRecord
transaction do
Post.without_timeout do
ModAction.log("permanently deleted post ##{id}")
ModAction.log("permanently deleted post ##{id}",:post_permanent_delete)
give_favorites_to_parent
update_children_on_destroy
@@ -1387,12 +1387,12 @@ class Post < ApplicationRecord
def ban!
update_column(:is_banned, true)
ModAction.log("banned post ##{id}")
ModAction.log("banned post ##{id}",:post_ban)
end
def unban!
update_column(:is_banned, false)
ModAction.log("unbanned post ##{id}")
ModAction.log("unbanned post ##{id}",:post_unban)
end
def delete!(reason, options = {})
@@ -1415,7 +1415,7 @@ class Post < ApplicationRecord
give_favorites_to_parent if options[:move_favorites]
unless options[:without_mod_action]
ModAction.log("deleted post ##{id}, reason: #{reason}")
ModAction.log("deleted post ##{id}, reason: #{reason}",:post_delete)
end
end
end
@@ -1438,7 +1438,7 @@ class Post < ApplicationRecord
self.approver_id = CurrentUser.id
flags.each {|x| x.resolve!}
save
ModAction.log("undeleted post ##{id}")
ModAction.log("undeleted post ##{id}",:post_undelete)
end
def replace!(params)