validates_length_of :subject, :maximum => 255
after_create :add_author_as_watcher, :update_parent_last_reply
+ after_update :update_messages_board
named_scope :visible, lambda {|*args| { :include => {:board => :project},
:conditions => Project.allowed_to_condition(args.shift || User.current, :view_messages, *args) } }
board.reset_counters!
end
- def after_update
+ def update_messages_board
if board_id_changed?
Message.update_all("board_id = #{board_id}", ["id = ? OR parent_id = ?", root.id, root.id])
Board.reset_counters!(board_id_was)