fixes #1903: First post of forum topic doesn't show "updated by" message
This commit is contained in:
@@ -19,6 +19,7 @@ class ForumTopic < ActiveRecord::Base
|
||||
validates_associated :original_post
|
||||
validates_inclusion_of :category_id, :in => CATEGORIES.keys
|
||||
accepts_nested_attributes_for :original_post
|
||||
after_update :update_orignal_post
|
||||
|
||||
module CategoryMethods
|
||||
extend ActiveSupport::Concern
|
||||
@@ -159,4 +160,10 @@ class ForumTopic < ActiveRecord::Base
|
||||
def undelete!
|
||||
update_attributes({:is_deleted => false}, :as => CurrentUser.role)
|
||||
end
|
||||
|
||||
def update_orignal_post
|
||||
if original_post
|
||||
original_post.update_columns(:updater_id => CurrentUser.id, :updated_at => Time.now)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user