Skip to content

Commit 00e52fb

Browse files
committed
shorten long line of ReportsHelper
git-svn-id: http://svn.redmine.org/redmine/trunk@20139 e93f8b46-1217-0410-a6f0-8f06a7374b81
1 parent 05c532b commit 00e52fb

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

app/helpers/reports_helper.rb

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,17 @@ module ReportsHelper
2121

2222
def aggregate(data, criteria)
2323
a = 0
24-
data.each { |row|
24+
data.each do |row|
2525
match = 1
26-
criteria.each { |k, v|
27-
match = 0 unless (row[k].to_s == v.to_s) || (k == 'closed' && (v == 0 ? ['f', false] : ['t', true]).include?(row[k]))
28-
} unless criteria.nil?
26+
criteria.each do |k, v|
27+
unless (row[k].to_s == v.to_s) ||
28+
(k == 'closed' &&
29+
(v == 0 ? ['f', false] : ['t', true]).include?(row[k]))
30+
match = 0
31+
end
32+
end unless criteria.nil?
2933
a = a + row["total"].to_i if match == 1
30-
} unless data.nil?
34+
end unless data.nil?
3135
a
3236
end
3337

0 commit comments

Comments
 (0)