Sha256: 85fe28df91009c91a42520adced14375f2adac12d367f08f92471e8d044592e4

Contents?: true

Size: 376 Bytes

Versions: 1

Compression:

Stored size: 376 Bytes

Contents

module FilterParam
  module Operators
    class EndsWith < FieldFilterOperator
      operator_tag :ew
      operand_data_type :string

      def self.sql(field, literal)
        super

        pattern = "%#{literal.value}"

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

FilterParam::Operator.register(FilterParam::Operators::EndsWith)

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
filter_param-0.1.2 lib/filter_param/operators/ends_with.rb