Actions
Bug #1751
closedReportCommon#status fails on ruby 1.9
Description
In ruby 1.9 the method each doesn't works for String type.
A suggested fix:
diff --git a/app/models/report_common.rb b/app/models/report_common.rb index a879a01..45af2fc 100644 --- a/app/models/report_common.rb +++ b/app/models/report_common.rb @@ -43,7 +43,13 @@ module ReportCommon def status(type = nil) raise "invalid type #{type}" if type and not METRIC.include?(type) h = {} - (type || METRIC).each do |m| + arr = [] + if type == nil + arr = METRIC + else + arr << type + end + arr.each do |m| h[m] = (read_attribute(self.class.report_status) || 0) >> (BIT_NUM*METRIC.index(m)) & MAX end type.nil? ? h : h[type]
Actions