Introduction
Introduction Statistics Contact Development Disclaimer Help
Fixed duplicate key sql error by preventing reporting_period from doing a time …
Log
Files
Refs
README
---
commit fa8af89304d38318f6a2cb4f2b01a6f7f2e6bc7d
parent 8791b1e44c216af03bcf53805cdfb642d49b20e0
Author: Myron Marston <[email protected]>
Date: Mon, 4 May 2009 15:43:15 +0800
Fixed duplicate key sql error by preventing reporting_period from doing a time …
Signed-off-by: Marco Otte-Witte <[email protected]>
Diffstat:
M lib/simplabs/reports_as_sparkline/… | 7 +++++++
1 file changed, 7 insertions(+), 0 deletions(-)
---
diff --git a/lib/simplabs/reports_as_sparkline/report_cache.rb b/lib/simplabs/r…
@@ -8,6 +8,13 @@ module Simplabs #:nodoc:
set_table_name :reports_as_sparkline_cache
+ # When reporting_period has a time zone conversion performed, we get dup…
+ # This occurs because find_cached_data will return a record set that is …
+ # have an end date. The SQL criteria reporting_period BETWEEN before_da…
+ # the last record that it should, because our end_date will not be time-…
+ # the reported_period in the database will be time-zone converted (ex: 5…
+ self.skip_time_zone_conversion_for_attributes = [:reporting_period]
+
def self.process(report, options, cache = true, &block) #:nodoc:
raise ArgumentError.new('A block must be given') unless block_given?
self.transaction do
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.