Class: FilterParam::Operators::StartsWith

Inherits:
FieldFilterOperator show all
Defined in:
lib/filter_param/operators/starts_with.rb

Class Method Summary collapse

Methods inherited from FieldFilterOperator

operand_data_type

Methods inherited from FilterParam::Operator

binaries, for, operator_tag, register, tag, type, unaries

Class Method Details

.sql(field, literal) ⇒ Object



7
8
9
10
11
12
13
# File 'lib/filter_param/operators/starts_with.rb', line 7

def self.sql(field, literal)
  super

  pattern = "#{literal.value}%"

  "#{field.actual_name} LIKE #{sql_quote(pattern)}"
end