Added additional mod actions

This commit is contained in:
BrokenEagle
2018-01-13 20:40:16 -08:00
parent fcdc61f111
commit 85f04a826a
4 changed files with 20 additions and 0 deletions

View File

@@ -28,6 +28,9 @@ class ForumTopic < ApplicationRecord
validates :title, :length => {:maximum => 255}
accepts_nested_attributes_for :original_post
after_update :update_orignal_post
after_save(:if => lambda {|rec| rec.is_locked? && rec.is_locked_changed?}) do |rec|
ModAction.log("locked forum topic ##{id} (title: #{title})",:forum_topic_lock)
end
module CategoryMethods
extend ActiveSupport::Concern
@@ -154,6 +157,14 @@ class ForumTopic < ApplicationRecord
user.level >= min_level
end
def create_mod_action_for_delete
ModAction.log("deleted forum topic ##{id} (title: #{title})",:forum_topic_delete)
end
def create_mod_action_for_undelete
ModAction.log("undeleted forum topic ##{id} (title: #{title})",:forum_topic_undelete)
end
def initialize_is_deleted
self.is_deleted = false if is_deleted.nil?
end