diff --git a/app/models/forum_topic.rb b/app/models/forum_topic.rb index 237fb91ca..bc0046a3e 100644 --- a/app/models/forum_topic.rb +++ b/app/models/forum_topic.rb @@ -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