Make sure the "condition" column is escaped. - reportable - Fork of reportable required by WarVox, from hdm/reportable.
 (DIR) Log
 (DIR) Files
 (DIR) Refs
 (DIR) README
       ---
 (DIR) commit dd5ce7bf2dd86866f616621ed9798b5d259b37e3
 (DIR) parent 3259cb4e113ad36fcd708d896622deb54ae9c608
 (HTM) Author: Eric Lindvall <eric@5stops.com>
       Date:   Wed, 23 Dec 2009 17:14:39 +0800
       
       Make sure the "condition" column is escaped.
       
       Diffstat:
         M lib/simplabs/reports_as_sparkline/… |       2 +-
         M spec/classes/report_cache_spec.rb   |       6 +++---
       
       2 files changed, 4 insertions(+), 4 deletions(-)
       ---
 (DIR) diff --git a/lib/simplabs/reports_as_sparkline/report_cache.rb b/lib/simplabs/reports_as_sparkline/report_cache.rb
       @@ -82,7 +82,7 @@ module Simplabs #:nodoc:
        
                def self.read_cached_data(report, options)
                  conditions = [
       -            'model_name = ? AND report_name = ? AND grouping = ? AND aggregation = ? AND condition = ?',
       +            'model_name = ? AND report_name = ? AND grouping = ? AND aggregation = ? AND `condition` = ?',
                    report.klass.to_s,
                    report.name.to_s,
                    options[:grouping].identifier.to_s,
 (DIR) diff --git a/spec/classes/report_cache_spec.rb b/spec/classes/report_cache_spec.rb
       @@ -122,7 +122,7 @@ describe Simplabs::ReportsAsSparkline::ReportCache do
            it 'should read existing data from the cache' do
              Simplabs::ReportsAsSparkline::ReportCache.should_receive(:all).once.with(
                :conditions => [
       -          'model_name = ? AND report_name = ? AND grouping = ? AND aggregation = ? AND condition = ? AND reporting_period >= ?',
       +          'model_name = ? AND report_name = ? AND grouping = ? AND aggregation = ? AND `condition` = ? AND reporting_period >= ?',
                  @report.klass.to_s,
                  @report.name.to_s,
                  @report.options[:grouping].identifier.to_s,
       @@ -141,7 +141,7 @@ describe Simplabs::ReportsAsSparkline::ReportCache do
              end_date = Time.now
              Simplabs::ReportsAsSparkline::ReportCache.should_receive(:all).once.with(
                :conditions => [
       -          'model_name = ? AND report_name = ? AND grouping = ? AND aggregation = ? AND condition = ? AND reporting_period BETWEEN ? AND ?',
       +          'model_name = ? AND report_name = ? AND grouping = ? AND aggregation = ? AND `condition` = ? AND reporting_period BETWEEN ? AND ?',
                  @report.klass.to_s,
                  @report.name.to_s,
                  @report.options[:grouping].identifier.to_s,
       @@ -162,7 +162,7 @@ describe Simplabs::ReportsAsSparkline::ReportCache do
              Simplabs::ReportsAsSparkline::ReportCache.should_receive(:find).once.with(
                :all,
                :conditions => [
       -          'model_name = ? AND report_name = ? AND grouping = ? AND aggregation = ? AND condition = ? AND reporting_period >= ?',
       +          'model_name = ? AND report_name = ? AND grouping = ? AND aggregation = ? AND `condition` = ? AND reporting_period >= ?',
                  @report.klass.to_s,
                  @report.name.to_s,
                  grouping.identifier.to_s,