Rails4: replace deprecated Relation#update_all at Repository model

git-svn-id: http://svn.redmine.org/redmine/trunk@12493 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Toshi MARUYAMA 2014-01-07 14:54:05 +00:00
parent 691e218a75
commit 9eaa4a7c1a
1 changed files with 1 additions and 1 deletions

View File

@ -402,7 +402,7 @@ class Repository < ActiveRecord::Base
self.is_default = true self.is_default = true
end end
if is_default? && is_default_changed? if is_default? && is_default_changed?
Repository.update_all(["is_default = ?", false], ["project_id = ?", project_id]) Repository.where(["project_id = ?", project_id]).update_all(["is_default = ?", false])
end end
end end