Class: Wice::FilterConditionsGeneratorBoolean

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:


716
717
718
719
720
721
722
723
724
725
726
727
728
729
# File 'lib/wice_grid.rb', line 716

def  generate_conditions(table_alias, opts)   #:nodoc:
  unless (opts.kind_of?(Array) && opts.size == 1)
    Wice.log "invalid parameters for the grid boolean filter - must be an one item array: #{opts.inspect}"
    return false
  end
  opts = opts[0]
  if opts == 'f'
    [" (#{@column.alias_or_table_name(table_alias)}.#{@column.name} = ? or #{@column.alias_or_table_name(table_alias)}.#{@column.name} is null) ", false]
  elsif opts == 't'
    [" #{@column.alias_or_table_name(table_alias)}.#{@column.name} = ?", true]
  else
    nil
  end
end