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]
Updated by Ohad Levy over 13 years ago
- Assignee set to Ohad Levy
- Target version set to 1.0
Updated by Ohad Levy over 13 years ago
- Status changed from New to Closed
- % Done changed from 0 to 100
Applied in changeset 249afd9c87e897caa9ba83602346a71ffbbb3bb1.
Actions