Introduction
Introduction Statistics Contact Development Disclaimer Help
refactored ReportCache.process a little more... - reportable - Fork of reportab…
Log
Files
Refs
README
---
commit a52fc4fb93ca12d16bc1f019de403d141e0c63a2
parent dea59962791f1628977ef04d95787cede7bd5fab
Author: Marco Otte-Witte <[email protected]>
Date: Thu, 15 Jan 2009 12:20:26 +0100
refactored ReportCache.process a little more...
Diffstat:
M lib/kvlr/reports_as_sparkline/repo… | 30 +++++++++++++++++----------…
1 file changed, 17 insertions(+), 13 deletions(-)
---
diff --git a/lib/kvlr/reports_as_sparkline/report_cache.rb b/lib/kvlr/reports_a…
@@ -10,19 +10,7 @@ module Kvlr #:nodoc:
cached_data = []
last_reporting_period_to_read = ReportingPeriod.first(options[:group…
if cache
- cached_data = self.find(
- :all,
- :conditions => [
- 'model_name = ? AND report_name = ? AND grouping = ? AND aggre…
- report.klass.to_s,
- report.name.to_s,
- options[:grouping].identifier.to_s,
- report.aggregation.to_s,
- last_reporting_period_to_read.date_time
- ],
- :limit => options[:limit],
- :order => 'reporting_period ASC'
- )
+ cached_data = find_cached_data(report, options, last_reporting_per…
last_reporting_period_to_read = ReportingPeriod.new(options[:group…
end
new_data = yield(last_reporting_period_to_read.date_time)
@@ -63,6 +51,22 @@ module Kvlr #:nodoc:
)
end
+ def self.find_cached_data(report, options, last_reporting_period_to_re…
+ self.find(
+ :all,
+ :conditions => [
+ 'model_name = ? AND report_name = ? AND grouping = ? AND aggrega…
+ report.klass.to_s,
+ report.name.to_s,
+ options[:grouping].identifier.to_s,
+ report.aggregation.to_s,
+ last_reporting_period_to_read.date_time
+ ],
+ :limit => options[:limit],
+ :order => 'reporting_period ASC'
+ )
+ end
+
end
end
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.