Class: Wice::FilterConditionsGeneratorDate

Inherits:
FilterConditionsGenerator show all
Defined in:
lib/wice_grid.rb

Overview

:nodoc:

Instance Method Summary collapse

Methods inherited from FilterConditionsGenerator

#initialize

Constructor Details

This class inherits a constructor from Wice::FilterConditionsGenerator

Instance Method Details

#generate_conditions(table_alias, opts) ⇒ Object

:nodoc:


802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
# File 'lib/wice_grid.rb', line 802

def generate_conditions(table_alias, opts)   #:nodoc:
  conditions = [[]]
  if opts[:fr]
    conditions[0] << " #{@column.alias_or_table_name(table_alias)}.#{@column.name} >= ? "
    conditions << opts[:fr]
  end

  if opts[:to]
    conditions[0] << " #{@column.alias_or_table_name(table_alias)}.#{@column.name} <= ? "
    conditions << opts[:to]
  end

  return false if conditions.size == 1

  conditions[0] = conditions[0].join(' and ')
  return conditions
end