summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>2014-02-14 02:33:00 +0000
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>2014-02-14 02:33:00 +0000
commit0aaf7f799aba40ef7edb3252fc5fbc398d54daf7 (patch)
treecc1f681fb8f4483ba6349952728d5cd2468159e1 /lib
parent3d79ddfe753782c69df36cddbe19f743e04f2daa (diff)
downloadredmine-0aaf7f799aba40ef7edb3252fc5fbc398d54daf7.tar.gz
redmine-0aaf7f799aba40ef7edb3252fc5fbc398d54daf7.zip
Rails4: replace deprecated Relation#sum with finder options at lib/redmine/helpers/time_report.rb
git-svn-id: http://svn.redmine.org/redmine/trunk@12881 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'lib')
-rw-r--r--lib/redmine/helpers/time_report.rb8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/redmine/helpers/time_report.rb b/lib/redmine/helpers/time_report.rb
index 2c71f098b..14a09694e 100644
--- a/lib/redmine/helpers/time_report.rb
+++ b/lib/redmine/helpers/time_report.rb
@@ -45,10 +45,10 @@ module Redmine
unless @criteria.empty?
time_columns = %w(tyear tmonth tweek spent_on)
@hours = []
- @scope.sum(:hours,
- :include => [:issue, :activity],
- :group => @criteria.collect{|criteria| @available_criteria[criteria][:sql]} + time_columns,
- :joins => @criteria.collect{|criteria| @available_criteria[criteria][:joins]}.compact).each do |hash, hours|
+ @scope.includes(:issue, :activity).
+ group(@criteria.collect{|criteria| @available_criteria[criteria][:sql]} + time_columns).
+ joins(@criteria.collect{|criteria| @available_criteria[criteria][:joins]}.compact).
+ sum(:hours).each do |hash, hours|
h = {'hours' => hours}
(@criteria + time_columns).each_with_index do |name, i|
h[name] = hash[i]