diff options
author | Go MAEDA <maeda@farend.jp> | 2022-10-28 07:50:11 +0000 |
---|---|---|
committer | Go MAEDA <maeda@farend.jp> | 2022-10-28 07:50:11 +0000 |
commit | ee1476f802d34ee31d1e1c990165165338867ff6 (patch) | |
tree | d7848fddb34b876dbe05864d0b04ec98d5db8893 /lib | |
parent | 6a55e94cd2ac8ed2462aa8b80ab9a96a8d43e25b (diff) | |
download | redmine-ee1476f802d34ee31d1e1c990165165338867ff6.tar.gz redmine-ee1476f802d34ee31d1e1c990165165338867ff6.zip |
Fix RuboCop offense Rails/Pluck (#37248).
git-svn-id: https://svn.redmine.org/redmine/trunk@21928 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'lib')
-rw-r--r-- | lib/redmine/helpers/time_report.rb | 4 |
1 files changed, 2 insertions, 2 deletions
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} |