Class: RailsAdmin::Adapters::Mongoid::StatementBuilder

Inherits:
RailsAdmin::AbstractModel::StatementBuilder show all
Defined in:
lib/rails_admin/adapters/mongoid.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)


211
212
213
214
215
216
217
218
219
220
# File 'lib/rails_admin/adapters/mongoid.rb', line 211

def unary_operators
  {
    '_blank' => {@column => {'$in' => [nil, '']}},
    '_present' => {@column => {'$nin' => [nil, '']}},
    '_null' => {@column => nil},
    '_not_null' => {@column => {'$ne' => nil}},
    '_empty' => {@column => ''},
    '_not_empty' => {@column => {'$ne' => ''}},
  }
end