fixes #1903: First post of forum topic doesn't show "updated by" message

This commit is contained in:
r888888888
2015-08-07 11:23:21 -07:00
parent 70c3143e27
commit 7215a39d98

View File

@@ -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