mirror of
https://github.com/meineerde/redmine.git
synced 2026-02-01 03:57:15 +00:00
Fix RuboCop Style/MultilineIfModifier in ReportsHelper by using safe navigation operator (#39887).
git-svn-id: https://svn.redmine.org/redmine/trunk@23166 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
b723fac008
commit
48a7fd50cb
@ -950,7 +950,6 @@ Style/MultilineIfModifier:
|
||||
- 'app/helpers/attachments_helper.rb'
|
||||
- 'app/helpers/custom_fields_helper.rb'
|
||||
- 'app/helpers/projects_helper.rb'
|
||||
- 'app/helpers/reports_helper.rb'
|
||||
- 'app/helpers/repositories_helper.rb'
|
||||
- 'app/helpers/search_helper.rb'
|
||||
- 'app/models/issue_query.rb'
|
||||
|
||||
@ -20,17 +20,17 @@
|
||||
module ReportsHelper
|
||||
def aggregate(data, criteria)
|
||||
a = 0
|
||||
data.each do |row|
|
||||
data&.each do |row|
|
||||
match = 1
|
||||
criteria.each do |k, v|
|
||||
criteria&.each do |k, v|
|
||||
unless (row[k].to_s == v.to_s) ||
|
||||
(k == 'closed' &&
|
||||
(v == 0 ? ['f', false] : ['t', true]).include?(row[k]))
|
||||
match = 0
|
||||
end
|
||||
end unless criteria.nil?
|
||||
end
|
||||
a = a + row["total"].to_i if match == 1
|
||||
end unless data.nil?
|
||||
end
|
||||
a
|
||||
end
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user