diff options
author | Toshi MARUYAMA <marutosijp2@yahoo.co.jp> | 2011-09-22 15:42:07 +0000 |
---|---|---|
committer | Toshi MARUYAMA <marutosijp2@yahoo.co.jp> | 2011-09-22 15:42:07 +0000 |
commit | 4ac5a2c338cee1a8c5d754803dbb52a6eb94ce2a (patch) | |
tree | 9ff40dd03eb7b1a2cb0d128edeb5113cc248895a /app/models/message.rb | |
parent | c23052aa08e16be12f4054ac3cb435d4c228f51f (diff) | |
download | redmine-4ac5a2c338cee1a8c5d754803dbb52a6eb94ce2a.tar.gz redmine-4ac5a2c338cee1a8c5d754803dbb52a6eb94ce2a.zip |
Rails3: model: replace deprecated 'after_destroy' method at Message model
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@7457 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/models/message.rb')
-rw-r--r-- | app/models/message.rb | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/app/models/message.rb b/app/models/message.rb index f4131dd97..10ee02cde 100644 --- a/app/models/message.rb +++ b/app/models/message.rb @@ -42,6 +42,7 @@ class Message < ActiveRecord::Base after_create :add_author_as_watcher, :update_parent_last_reply after_update :update_messages_board + after_destroy :reset_board_counters named_scope :visible, lambda {|*args| { :include => {:board => :project}, :conditions => Project.allowed_to_condition(args.shift || User.current, :view_messages, *args) } } @@ -70,7 +71,7 @@ class Message < ActiveRecord::Base end end - def after_destroy + def reset_board_counters board.reset_counters! end |