mirror of
https://github.com/meineerde/redmine.git
synced 2025-12-24 01:11:12 +00:00
shorten long line of ReportsHelper
git-svn-id: http://svn.redmine.org/redmine/trunk@20139 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
05c532bded
commit
00e52fb9de
@ -21,13 +21,17 @@ module ReportsHelper
|
||||
|
||||
def aggregate(data, criteria)
|
||||
a = 0
|
||||
data.each { |row|
|
||||
data.each do |row|
|
||||
match = 1
|
||||
criteria.each { |k, v|
|
||||
match = 0 unless (row[k].to_s == v.to_s) || (k == 'closed' && (v == 0 ? ['f', false] : ['t', true]).include?(row[k]))
|
||||
} unless criteria.nil?
|
||||
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?
|
||||
a = a + row["total"].to_i if match == 1
|
||||
} unless data.nil?
|
||||
end unless data.nil?
|
||||
a
|
||||
end
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user