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.
135 136 137 138 139 140 |
# File 'lib/rails_admin/abstract_model.rb', line 135 def initialize(column, type, value, operator) @column = column @type = type @value = value @operator = operator end |
Instance Method Details
#to_statement ⇒ Object
142 143 144 145 146 147 |
# File 'lib/rails_admin/abstract_model.rb', line 142 def to_statement return if [@operator, @value].any? { |v| v == '_discard' } unary_operators[@operator] || unary_operators[@value] || build_statement_for_type_generic end |