Partial fix for issue #2824

This commit is contained in:
Type-kun
2017-01-08 23:58:52 +05:00
parent 3baa69c46c
commit c44c40c759
2 changed files with 4 additions and 4 deletions

View File

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

View File

@@ -20,10 +20,10 @@ class ForumPost < ActiveRecord::Base
before_destroy :validate_topic_is_unlocked
after_save :delete_topic_if_original_post
after_update(:if => lambda {|rec| rec.updater_id != rec.creator_id}) do
ModAction.log("#{CurrentUser.name} updated forum post ##{rec.id}")
ModAction.log("#{CurrentUser.name} updated forum post ##{self.id}")
end
after_destroy(:if => lambda {|rec| rec.updater_id != rec.creator_id}) do
ModAction.log("#{CurrentUser.name} deleted forum post ##{rec.id}")
ModAction.log("#{CurrentUser.name} deleted forum post ##{self.id}")
end
mentionable(
:message_field => :body,