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

@@ -12,11 +12,11 @@ class Comment < ApplicationRecord
before_validation :initialize_updater
after_create :update_last_commented_at_on_create
after_update(:if => lambda {|rec| (!rec.is_deleted? || !rec.is_deleted_changed?) && CurrentUser.id != rec.creator_id}) do |rec|
ModAction.log("comment ##{rec.id} updated by #{CurrentUser.name}")
ModAction.log("comment ##{rec.id} updated by #{CurrentUser.name}",:comment_update)
end
after_save :update_last_commented_at_on_destroy, :if => lambda {|rec| rec.is_deleted? && rec.is_deleted_changed?}
after_save(:if => lambda {|rec| rec.is_deleted? && rec.is_deleted_changed? && CurrentUser.id != rec.creator_id}) do |rec|
ModAction.log("comment ##{rec.id} deleted by #{CurrentUser.name}")
ModAction.log("comment ##{rec.id} deleted by #{CurrentUser.name}",:comment_delete)
end
attr_accessible :body, :post_id, :do_not_bump_post, :is_deleted, :as => [:member, :gold, :platinum, :builder, :moderator, :admin]
attr_accessible :is_sticky, :as => [:moderator, :admin]