fixed bug where new_data is an OrderedHash and does not respond to map! - reportable - Fork of reportable required by WarVox, from hdm/reportable.
 (DIR) Log
 (DIR) Files
 (DIR) Refs
 (DIR) README
       ---
 (DIR) commit 4bb49b35c74bc87eb43f7c3fb638273ab11da7a3
 (DIR) parent c3fb5b3acc00333cfe3b2b5d61963a15e7859760
 (HTM) Author: Marco Otte-Witte <marco.otte-witte@simplabs.com>
       Date:   Fri, 20 Mar 2009 16:32:02 +0100
       
       fixed bug where new_data is an OrderedHash and does not respond to map!
       
       Diffstat:
         M lib/kvlr/reports_as_sparkline/repo… |       2 +-
       
       1 file changed, 1 insertion(+), 1 deletion(-)
       ---
 (DIR) diff --git a/lib/kvlr/reports_as_sparkline/report_cache.rb b/lib/kvlr/reports_as_sparkline/report_cache.rb
       @@ -25,7 +25,7 @@ module Kvlr #:nodoc:
              private
        
                def self.prepare_result(new_data, cached_data, report, options, cache = true)
       -          new_data.map! { |data| [ReportingPeriod.from_db_string(options[:grouping], data[0]), data[1]] }
       +          new_data = new_data.map { |data| [ReportingPeriod.from_db_string(options[:grouping], data[0]), data[1]] }
                  result = cached_data.map { |cached| [cached.reporting_period, cached.value] }
                  current_reporting_period = ReportingPeriod.new(options[:grouping])
                  reporting_period = cached_data.empty? ? ReportingPeriod.first(options[:grouping], options[:limit]) : ReportingPeriod.new(options[:grouping], cached_data.last.reporting_period).next