diff options
author | Toshi MARUYAMA <marutosijp2@yahoo.co.jp> | 2011-09-01 00:43:03 +0000 |
---|---|---|
committer | Toshi MARUYAMA <marutosijp2@yahoo.co.jp> | 2011-09-01 00:43:03 +0000 |
commit | 52dd8b56c9d908e036e34930ac0aef32010a399e (patch) | |
tree | a3c5ca5bd063aecc01b1d2847388d6bdee6c3713 /app | |
parent | 51e2d89608e998db659dfc6ad62137e9c1d9a7e4 (diff) | |
download | redmine-52dd8b56c9d908e036e34930ac0aef32010a399e.tar.gz redmine-52dd8b56c9d908e036e34930ac0aef32010a399e.zip |
Rails3: replace deprecated 'after_create' method at Message model.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@6936 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app')
-rw-r--r-- | app/models/message.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/app/models/message.rb b/app/models/message.rb index d8ad0bd04..3207e01f0 100644 --- a/app/models/message.rb +++ b/app/models/message.rb @@ -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 |