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, #to_statement

Constructor Details

#initialize(column, type, value, operator, adapter_name) ⇒ StatementBuilder

Returns a new instance of StatementBuilder.


160
161
162
163
# File 'lib/rails_admin/adapters/active_record.rb', line 160

def initialize(column, type, value, operator, adapter_name)
  super column, type, value, operator
  @adapter_name = adapter_name
end

Instance Method Details

#unary_operatorsObject (protected)


167
168
169
170
171
172
173
174
175
176
# File 'lib/rails_admin/adapters/active_record.rb', line 167

def unary_operators
  case @type
  when :boolean
    boolean_unary_operators
  when :integer, :decimal, :float
    numeric_unary_operators
  else
    generic_unary_operators
  end
end