lib/searchgasm/condition/blank.rb in searchgasm-1.2.2 vs lib/searchgasm/condition/blank.rb in searchgasm-1.3.0

- old
+ new

@@ -1,21 +1,21 @@ module Searchgasm module Condition class Blank < Base - self.type_cast_sql_type = "boolean" + self.value_type = :boolean class << self - def aliases_for_column(column) - ["#{column.name}_is_blank"] + def condition_names_for_column + super + ["is_blank"] end end def to_conditions(value) # Some databases handle null values differently, let AR handle this if value == true - "#{quoted_table_name}.#{quoted_column_name} is NULL or #{quoted_table_name}.#{quoted_column_name} = ''" + "#{column_sql} is NULL or #{column_sql} = ''" elsif value == false - "#{quoted_table_name}.#{quoted_column_name} is NOT NULL and #{quoted_table_name}.#{quoted_column_name} != ''" + "#{column_sql} is NOT NULL and #{column_sql} != ''" end end end end end \ No newline at end of file