v1.3.1 - reportable - Fork of reportable required by WarVox, from hdm/reportable.
 (DIR) Log
 (DIR) Files
 (DIR) Refs
 (DIR) README
       ---
 (DIR) commit 38bd74361bc517615c02f441e702166f1b0cb821
 (DIR) parent 1b697477d79a5e17e869b4acc1f6be4330226037
 (HTM) Author: Marco Otte-Witte <marco.otte-witte@simplabs.com>
       Date:   Tue,  5 May 2009 19:46:09 +0200
       
       v1.3.1
       
       Diffstat:
         M HISTORY.rdoc                        |       5 +++++
         M generators/reports_as_sparkline_mi… |      15 ++++++---------
         M lib/simplabs/reports_as_sparkline/… |       2 +-
       
       3 files changed, 12 insertions(+), 10 deletions(-)
       ---
 (DIR) diff --git a/HISTORY.rdoc b/HISTORY.rdoc
       @@ -1,3 +1,8 @@
       +=== v1.3.1
       +
       +* fixed migration template
       +* fixed data type returned by the report methods
       +
        === v1.3
        
        * Fixed another bug where two report runs with different :end_date values would lead to invalid data
 (DIR) diff --git a/generators/reports_as_sparkline_migration/templates/migration.erb b/generators/reports_as_sparkline_migration/templates/migration.erb
       @@ -8,7 +8,6 @@ class <%= class_name %> < ActiveRecord::Migration
              t.string   :aggregation,      :null => false
              t.float    :value,            :null => false, :default => 0
              t.datetime :reporting_period, :null => false
       -      t.integer  :run_limit,        :null => false
        
              t.timestamps
            end
       @@ -17,22 +16,20 @@ class <%= class_name %> < ActiveRecord::Migration
              :model_name,
              :report_name,
              :grouping,
       -      :aggregation,
       -      :run_limit
       -    ], :name => :name_model_grouping_agregation_run_limit
       +      :aggregation
       +    ], :name => :name_model_grouping_agregation
            add_index :reports_as_sparkline_cache, [
              :model_name,
              :report_name,
              :grouping,
              :aggregation,
       -      :reporting_period,
       -      :run_limit
       -    ], :unique => true, :name => :name_model_grouping_aggregation_period_run_limit
       +      :reporting_period
       +    ], :unique => true, :name => :name_model_grouping_aggregation_period
          end
        
          def self.down
       -    remove_index :reports_as_sparkline_cache, :name => :name_model_grouping_agregation_run_limit
       -    remove_index :reports_as_sparkline_cache, :name => :name_model_grouping_aggregation_period_run_limit
       +    remove_index :reports_as_sparkline_cache, :name => :name_model_grouping_agregation
       +    remove_index :reports_as_sparkline_cache, :name => :name_model_grouping_aggregation_period
        
            drop_table :reports_as_sparkline_cache
          end
 (DIR) diff --git a/lib/simplabs/reports_as_sparkline/report_cache.rb b/lib/simplabs/reports_as_sparkline/report_cache.rb
       @@ -52,7 +52,7 @@ module Simplabs #:nodoc:
                  result = []
                  while reporting_period < (options[:end_date] ? ReportingPeriod.new(options[:grouping], options[:end_date]).next : current_reporting_period)
                    if cached = cached_data.find { |cached| reporting_period == cached[0] }
       -              result << cached
       +              result << [cached[0].date_time, cached[1]]
                    else
                      new_cached = build_cached_data(report, options[:grouping], reporting_period, find_value(new_data, reporting_period))
                      new_cached.save! if cache