Class: Babik::Selection::Operation::StartsWith
- Inherits:
-
BinaryOperation
- Object
- Base
- BinaryOperation
- Babik::Selection::Operation::StartsWith
- Defined in:
- lib/babik/queryset/lib/selection/operation/operations.rb
Direct Known Subclasses
Constant Summary collapse
- SQL_OPERATOR =
'LIKE'
Instance Attribute Summary
Attributes inherited from Base
#field, #sql_operation, #sql_operation_template, #value
Instance Method Summary collapse
Methods inherited from BinaryOperation
Methods inherited from Base
date_special_cases, #db_engine, escape, factory, #initialize, initialize_operation, initialize_operators, operator?, special_cases, #to_s
Constructor Details
This class inherits a constructor from Babik::Selection::Operation::BinaryOperation
Instance Method Details
#_init_sql_operation ⇒ Object
129 130 131 132 |
# File 'lib/babik/queryset/lib/selection/operation/operations.rb', line 129 def _init_sql_operation escaped_value = self.class.escape("#{@value}%") @sql_operation = @sql_operation_template.sub('?field', @field).sub('?value', escaped_value) end |