Sha256: f3af0744c9205d0dff1c7501a92e5a164a036c796ce065c524d46e2d4a9a4d1e

Contents?: true

Size: 328 Bytes

Versions: 4

Compression:

Stored size: 328 Bytes

Contents

# frozen_string_literal: true

module Pragma
  module Filter
    class Like < Base
      attr_reader :column

      def initialize(column:, **other)
        super(**other)
        @column = column
      end

      def apply(relation:, value:)
        relation.where("#{column} LIKE ?", "%#{value}%")
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
pragma-2.5.0 lib/pragma/filter/like.rb
pragma-2.4.0 lib/pragma/filter/like.rb
pragma-2.3.0 lib/pragma/filter/like.rb
pragma-2.2.0 lib/pragma/filter/like.rb