Class: Babik::Selection::Operation::IsNull

Inherits:
Base
  • Object
show all
Defined in:
lib/babik/queryset/lib/selection/operation/operations.rb

Overview

IS NULL operation

Instance Attribute Summary

Attributes inherited from Base

#field, #sql_operation, #sql_operation_template, #value

Instance Method Summary collapse

Methods inherited from Base

#_init_sql_operation, date_special_cases, #db_engine, escape, factory, initialize_operation, initialize_operators, operator?, special_cases, #to_s

Constructor Details

#initialize(field, value) ⇒ IsNull

Returns a new instance of IsNull.



79
80
81
82
# File 'lib/babik/queryset/lib/selection/operation/operations.rb', line 79

def initialize(field, value)
  sql_operation = value ? '?field IS NULL' : '?field IS NOT NULL'
  super(field, sql_operation, value)
end