From 5b77bd0076e8fd3cebfc99c0ab2fdfd388169dae Mon Sep 17 00:00:00 2001 From: Toshi MARUYAMA Date: Wed, 8 Jan 2014 04:57:56 +0000 Subject: [PATCH] Rails4: replace deprecated Relation#update_all at IssueStatus model git-svn-id: http://svn.redmine.org/redmine/trunk@12511 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/models/issue_status.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/models/issue_status.rb b/app/models/issue_status.rb index 0e8c9ea94..aa7987d00 100644 --- a/app/models/issue_status.rb +++ b/app/models/issue_status.rb @@ -32,7 +32,7 @@ class IssueStatus < ActiveRecord::Base scope :named, lambda {|arg| where("LOWER(#{table_name}.name) = LOWER(?)", arg.to_s.strip)} def update_default - IssueStatus.update_all({:is_default => false}, ['id <> ?', id]) if self.is_default? + IssueStatus.where(['id <> ?', id]).update_all({:is_default => false}) if self.is_default? end # Returns the default status for new issues @@ -44,7 +44,7 @@ class IssueStatus < ActiveRecord::Base def self.update_issue_done_ratios if Issue.use_status_for_done_ratio? IssueStatus.where("default_done_ratio >= 0").all.each do |status| - Issue.update_all({:done_ratio => status.default_done_ratio}, {:status_id => status.id}) + Issue.where({:status_id => status.id}).update_all({:done_ratio => status.default_done_ratio}) end end