Class: RailsAdmin::AbstractModel::StatementBuilder

Inherits:
Object
  • Object
show all
Defined in:
lib/rails_admin/abstract_model.rb

Defined Under Namespace

Classes: FilteringDuration

Instance Method Summary collapse

Constructor Details

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

Returns a new instance of StatementBuilder.



118
119
120
121
122
123
# File 'lib/rails_admin/abstract_model.rb', line 118

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

Instance Method Details

#to_statementObject



125
126
127
128
129
# File 'lib/rails_admin/abstract_model.rb', line 125

def to_statement
  return if [@operator, @value].any? { |v| v == '_discard' }
  unary_operators[@operator] || unary_operators[@value] ||
    build_statement_for_type_generic
end