Class: RailsAdmin::Adapters::ActiveRecord::StatementBuilder

Inherits:
RailsAdmin::AbstractModel::StatementBuilder show all
Defined in:
lib/rails_admin/adapters/active_record.rb

Instance Method Summary collapse

Methods inherited from RailsAdmin::AbstractModel::StatementBuilder

#build_statement_for_date, #build_statement_for_datetime_or_timestamp, #build_statement_for_integer_decimal_or_float, #build_statement_for_type_generic, #get_filtering_duration, #initialize, #to_statement

Constructor Details

This class inherits a constructor from RailsAdmin::AbstractModel::StatementBuilder

Instance Method Details

#unary_operatorsObject (protected)


143
144
145
146
147
148
149
150
151
152
# File 'lib/rails_admin/adapters/active_record.rb', line 143

def unary_operators
  {
    '_blank' => ["(#{@column} IS NULL OR #{@column} = '')"],
    '_present' => ["(#{@column} IS NOT NULL AND #{@column} != '')"],
    '_null' => ["(#{@column} IS NULL)"],
    '_not_null' => ["(#{@column} IS NOT NULL)"],
    '_empty' => ["(#{@column} = '')"],
    '_not_empty' => ["(#{@column} != '')"],
  }
end