]> source.dussan.org Git - redmine.git/commitdiff
Rails3: replace deprecated 'after_create' method at Message model.
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Thu, 1 Sep 2011 00:43:03 +0000 (00:43 +0000)
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Thu, 1 Sep 2011 00:43:03 +0000 (00:43 +0000)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@6936 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/models/message.rb

index d8ad0bd04e8b86dab81e1895ad34418a6c9acc0f..3207e01f0c2672b7708b08ad647cd7a09fdf6752 100644 (file)
@@ -40,7 +40,7 @@ class Message < ActiveRecord::Base
   validates_presence_of :board, :subject, :content
   validates_length_of :subject, :maximum => 255
 
-  after_create :add_author_as_watcher
+  after_create :add_author_as_watcher, :update_parent_last_reply
 
   named_scope :visible, lambda {|*args| { :include => {:board => :project},
                                           :conditions => Project.allowed_to_condition(args.shift || User.current, :view_messages, *args) } }
@@ -54,7 +54,7 @@ class Message < ActiveRecord::Base
     errors.add_to_base 'Topic is locked' if root.locked? && self != root
   end
 
-  def after_create
+  def update_parent_last_reply
     if parent
       parent.reload.update_attribute(:last_reply_id, self.id)
     end