lib/searchgasm/condition/nil.rb in searchgasm-1.2.2 vs lib/searchgasm/condition/nil.rb in searchgasm-1.3.0
- old
+ new
@@ -1,20 +1,20 @@
module Searchgasm
module Condition
class Nil < Base
- self.type_cast_sql_type = "boolean"
+ self.value_type = :boolean
class << self
- def aliases_for_column(column)
- ["#{column.name}_is_nil", "#{column.name}_is_null", "#{column.name}_null"]
+ def condition_names_for_column
+ super + ["is_nil", "is_null", "null"]
end
end
def to_conditions(value)
if value == true
- "#{quoted_table_name}.#{quoted_column_name} is NULL"
+ "#{column_sql} is NULL"
elsif value == false
- "#{quoted_table_name}.#{quoted_column_name} is NOT NULL"
+ "#{column_sql} is NOT NULL"
end
end
end
end
end
\ No newline at end of file