From d12c8e8397ba5dcf6d1babf535d7debf2b48edab Mon Sep 17 00:00:00 2001 From: Toshi MARUYAMA Date: Thu, 9 Jan 2014 03:34:58 +0000 Subject: [PATCH] Rails4: replace deprecated Relation#update_all at Repository model git-svn-id: http://svn.redmine.org/redmine/trunk@12546 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/models/repository.rb | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/app/models/repository.rb b/app/models/repository.rb index 9ae09e722..4d2ccefaa 100644 --- a/app/models/repository.rb +++ b/app/models/repository.rb @@ -281,9 +281,8 @@ class Repository < ActiveRecord::Base new_user_id = h[committer] if new_user_id && (new_user_id.to_i != user_id.to_i) new_user_id = (new_user_id.to_i > 0 ? new_user_id.to_i : nil) - Changeset.update_all( - "user_id = #{ new_user_id.nil? ? 'NULL' : new_user_id }", - ["repository_id = ? AND committer = ?", id, committer]) + Changeset.where(["repository_id = ? AND committer = ?", id, committer]). + update_all("user_id = #{new_user_id.nil? ? 'NULL' : new_user_id}") end end @committers = nil