Class: ActiveRecordSeek::Operators::CiBaseOperator
- Inherits:
-
BaseOperator
- Object
- BaseOperator
- ActiveRecordSeek::Operators::CiBaseOperator
show all
- Defined in:
- lib/active_record_seek/operators/ci_base_operator.rb
Instance Method Summary
collapse
#apply, #arel_column, #arel_table, #arel_value
#after_initialize, #initialize, #instance_variable_reset, #instance_variable_yield, #set
Instance Method Details
#arel_operation ⇒ Object
19
20
21
|
# File 'lib/active_record_seek/operators/ci_base_operator.rb', line 19
def arel_operation
ci_arel_column.send(component.operator, ci_arel_value)
end
|
#ci_arel_column ⇒ Object
5
6
7
|
# File 'lib/active_record_seek/operators/ci_base_operator.rb', line 5
def ci_arel_column
arel_column.lower
end
|
#ci_arel_value(value = arel_value) ⇒ Object
9
10
11
12
13
14
15
16
17
|
# File 'lib/active_record_seek/operators/ci_base_operator.rb', line 9
def ci_arel_value(value = arel_value)
if value.is_a?(Array)
value.map { |v| ci_arel_value(v) }
elsif value.is_a?(String)
arel_table.lower(value)
else
value
end
end
|