Class: RailsAdmin::AbstractModel::StatementBuilder
- Inherits:
-
Object
- Object
- RailsAdmin::AbstractModel::StatementBuilder
- Defined in:
- lib/rails_admin/abstract_model.rb
Direct Known Subclasses
RailsAdmin::Adapters::ActiveRecord::StatementBuilder, RailsAdmin::Adapters::Mongoid::StatementBuilder
Defined Under Namespace
Classes: FilteringDuration
Instance Method Summary collapse
-
#initialize(column, type, value, operator) ⇒ StatementBuilder
constructor
A new instance of StatementBuilder.
- #to_statement ⇒ Object
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_statement ⇒ Object
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 |