summaryrefslogtreecommitdiffstats
path: root/app/models/message.rb
diff options
context:
space:
mode:
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>2014-01-08 03:51:50 +0000
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>2014-01-08 03:51:50 +0000
commitab6ac3b08fe84707c80ac74289ff630efe220932 (patch)
tree52af425f2ed554ef0268cebc385b539769d23143 /app/models/message.rb
parent07880008098d77cd7233a32b6abf7189e64d4dcd (diff)
downloadredmine-ab6ac3b08fe84707c80ac74289ff630efe220932.tar.gz
redmine-ab6ac3b08fe84707c80ac74289ff630efe220932.zip
Rails4: replace deprecated Relation#update_all at Message model
git-svn-id: http://svn.redmine.org/redmine/trunk@12502 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/models/message.rb')
-rw-r--r--app/models/message.rb4
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