From ee1476f802d34ee31d1e1c990165165338867ff6 Mon Sep 17 00:00:00 2001 From: Go MAEDA Date: Fri, 28 Oct 2022 07:50:11 +0000 Subject: Fix RuboCop offense Rails/Pluck (#37248). git-svn-id: https://svn.redmine.org/redmine/trunk@21928 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- lib/redmine/helpers/time_report.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib') diff --git a/lib/redmine/helpers/time_report.rb b/lib/redmine/helpers/time_report.rb index 2ae5fd8eb..449869c9f 100644 --- a/lib/redmine/helpers/time_report.rb +++ b/lib/redmine/helpers/time_report.rb @@ -71,10 +71,10 @@ module Redmine end end - min = @hours.collect {|row| row['spent_on']}.min + min = @hours.pluck('spent_on').min @from = min ? min.to_date : User.current.today - max = @hours.collect {|row| row['spent_on']}.max + max = @hours.pluck('spent_on').max @to = max ? max.to_date : User.current.today @total_hours = @hours.inject(0) {|s,k| s = s + k['hours'].to_f} -- cgit v1.2.3