| use join instead of to_s to serialize conditions for the report-cache because r… | |
| Log | |
| Files | |
| Refs | |
| README | |
| --- | |
| commit 41036d1dd9fb08c4d5959c2147c0135b1c4daf13 | |
| parent a631f8df0e52e45eae135bf8ecf158b08a7374a3 | |
| Author: Lars Kuhnt <[email protected]> | |
| Date: Fri, 22 Oct 2010 12:36:47 +0200 | |
| use join instead of to_s to serialize conditions for the report-cache because r… | |
| Diffstat: | |
| M lib/saulabs/reportable/report_cach… | 5 +++-- | |
| 1 file changed, 3 insertions(+), 2 deletions(-) | |
| --- | |
| diff --git a/lib/saulabs/reportable/report_cache.rb b/lib/saulabs/reportable/re… | |
| @@ -110,13 +110,14 @@ module Saulabs | |
| :report_name => report.name.to_s, | |
| :grouping => grouping.identifier.to_s, | |
| :aggregation => report.aggregation.to_s, | |
| - :conditions => conditions.to_s, | |
| + :conditions => conditions.join(''), | |
| :reporting_period => reporting_period.date_time, | |
| :value => value | |
| ) | |
| end | |
| def self.read_cached_data(report, options) | |
| + options[:conditions] ||= [] | |
| conditions = [ | |
| %w(model_name report_name grouping aggregation conditions).map do … | |
| "#{self.connection.quote_column_name(column_name)} = ?" | |
| @@ -125,7 +126,7 @@ module Saulabs | |
| report.name.to_s, | |
| options[:grouping].identifier.to_s, | |
| report.aggregation.to_s, | |
| - options[:conditions].to_s | |
| + options[:conditions].join('') | |
| ] | |
| first_reporting_period = get_first_reporting_period(options) | |
| last_reporting_period = get_last_reporting_period(options) |