]> source.dussan.org Git - redmine.git/commitdiff
Rails4: replace deprecated Relation#update_all at Repository model
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Tue, 7 Jan 2014 14:54:05 +0000 (14:54 +0000)
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Tue, 7 Jan 2014 14:54:05 +0000 (14:54 +0000)
git-svn-id: http://svn.redmine.org/redmine/trunk@12493 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/models/repository.rb

index de3ca99a6fb25d5c583269d30e8cf060291c5e0a..9ae09e722cef6610532b8f51f3c7f7e6993e8075 100644 (file)
@@ -402,7 +402,7 @@ class Repository < ActiveRecord::Base
       self.is_default = true
     end
     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