summaryrefslogtreecommitdiffstats
path: root/app/models/issue_status.rb
diff options
context:
space:
mode:
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>2014-01-08 04:57:56 +0000
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>2014-01-08 04:57:56 +0000
commit5b77bd0076e8fd3cebfc99c0ab2fdfd388169dae (patch)
tree1323087339c3c90ce9b0b5c507d7819835f39aa8 /app/models/issue_status.rb
parentc4a9339e3f7e9073d5de46eea43464fae45e1eca (diff)
downloadredmine-5b77bd0076e8fd3cebfc99c0ab2fdfd388169dae.tar.gz
redmine-5b77bd0076e8fd3cebfc99c0ab2fdfd388169dae.zip
Rails4: replace deprecated Relation#update_all at IssueStatus model
git-svn-id: http://svn.redmine.org/redmine/trunk@12511 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/models/issue_status.rb')
-rw-r--r--app/models/issue_status.rb4
1 files 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