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

app/models/message.rb

index f4131dd975d07c81a25da55f38f508dd5810c068..10ee02cde782b66db776e9b8e82ecc20935269f2 100644 (file)
@@ -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