Introduction
Introduction Statistics Contact Development Disclaimer Help
(hopefully ;) fixed bug in ReportCache - reportable - Fork of reportable requir…
Log
Files
Refs
README
---
commit c7ad0fb7242250e5f50eb5ac4edf2e278e436a7c
parent baf5e26d2090c2390f178f3405728f9f2caf38cf
Author: Marco Otte-Witte <[email protected]>
Date: Tue, 20 Jan 2009 18:30:28 +0100
(hopefully ;) fixed bug in ReportCache
Diffstat:
M lib/kvlr/reports_as_sparkline/repo… | 4 ++--
M spec/classes/report_cache_spec.rb | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/lib/kvlr/reports_as_sparkline/report_cache.rb b/lib/kvlr/reports_a…
@@ -11,7 +11,7 @@ module Kvlr #:nodoc:
first_reporting_period = ReportingPeriod.first(options[:grouping], o…
if cache
cached_data = find_cached_data(report, options, first_reporting_pe…
- last_cached_reporting_period = (ReportingPeriod.new(options[:group…
+ last_cached_reporting_period = cached_data.empty? ? nil : Reportin…
end
new_data = if !options[:live_data] && last_cached_reporting_period =…
[]
@@ -28,7 +28,7 @@ module Kvlr #:nodoc:
new_data.map! { |data| [ReportingPeriod.from_db_string(options[:grou…
result = cached_data.map { |cached| [cached.reporting_period, cached…
current_reporting_period = ReportingPeriod.new(options[:grouping])
- reporting_period = (cached_data.last.reporting_period.next rescue Re…
+ reporting_period = cached_data.empty? ? ReportingPeriod.first(option…
while reporting_period < current_reporting_period
cached = build_cached_data(report, options[:grouping], reporting_p…
cached.save! if cache
diff --git a/spec/classes/report_cache_spec.rb b/spec/classes/report_cache_spec…
@@ -43,7 +43,7 @@ describe Kvlr::ReportsAsSparkline::ReportCache do
Time.now - 3.send(@report.options[:grouping].identifier)
)
cached = Kvlr::ReportsAsSparkline::ReportCache.new
- cached.stub!(:reporting_period).and_return(reporting_period)
+ cached.stub!(:reporting_period).and_return(reporting_period.date_time)
Kvlr::ReportsAsSparkline::ReportCache.stub!(:find).and_return([cached])
Kvlr::ReportsAsSparkline::ReportCache.process(@report, @options) do |b…
@@ -77,7 +77,7 @@ describe Kvlr::ReportsAsSparkline::ReportCache do
Time.now - 3.send(@report.options[:grouping].identifier)
)
cached = Kvlr::ReportsAsSparkline::ReportCache.new
- cached.stub!(:reporting_period).and_return(reporting_period)
+ cached.stub!(:reporting_period).and_return(reporting_period.date_time)
Kvlr::ReportsAsSparkline::ReportCache.stub!(:find).and_return([cached])
Kvlr::ReportsAsSparkline::ReportCache.process(@report, @report.options…
You are viewing proxied material from jay.scot. The copyright of proxied material belongs to its original authors. Any comments or complaints in relation to proxied material should be directed to the original authors of the content concerned. Please see the disclaimer for more details.