diff options
Diffstat (limited to 'app/models/message.rb')
-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 4335fefa9..c4eb27848 100644 --- a/app/models/message.rb +++ b/app/models/message.rb @@ -68,7 +68,7 @@ class Message < ActiveRecord::Base def update_messages_board if board_id_changed? - Message.update_all({:board_id => board_id}, ["id = ? OR parent_id = ?", root.id, root.id]) + Message.where(["id = ? OR parent_id = ?", root.id, root.id]).update_all({:board_id => board_id}) Board.reset_counters!(board_id_was) Board.reset_counters!(board_id) end @@ -76,7 +76,7 @@ class Message < ActiveRecord::Base def reset_counters! if parent && parent.id - Message.update_all({:last_reply_id => parent.children.maximum(:id)}, {:id => parent.id}) + Message.where({:id => parent.id}).update_all({:last_reply_id => parent.children.maximum(:id)}) end board.reset_counters! end |