Sha256: 8e497cdf08f57505698d4f95dc9bfa6e56e09d3d1155d94cded23462b6be601e

Contents?: true

Size: 788 Bytes

Versions: 12

Compression:

Stored size: 788 Bytes

Contents

# rubocop:disable Naming/MethodName
# rubocop:disable Naming/UncommunicativeMethodParamName

module Arel
  module Nodes
    # Postgres: https://www.postgresql.org/docs/9/functions-matching.html
    class Similar < Arel::Nodes::Matches
      def initialize(left, right, escape = nil)
        super(left, right, escape, false)
      end
    end
  end

  module Visitors
    class ToSql
      def visit_Arel_Nodes_Similar(o, collector)
        visit o.left, collector
        collector << ' SIMILAR TO '
        visit o.right, collector
        if o.escape
          collector << ' ESCAPE '
          visit o.escape, collector
        else
          collector
        end
      end
    end
  end
end

# rubocop:enable Naming/MethodName
# rubocop:enable Naming/UncommunicativeMethodParamName

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
arel_toolkit-0.4.9 lib/arel/extensions/similar.rb
arel_toolkit-0.4.8 lib/arel/extensions/similar.rb
arel_toolkit-0.4.7 lib/arel/extensions/similar.rb
arel_toolkit-0.4.6 lib/arel/extensions/similar.rb
arel_toolkit-0.4.5 lib/arel/extensions/similar.rb
arel_toolkit-0.4.4 lib/arel/extensions/similar.rb
arel_toolkit-0.4.3 lib/arel/extensions/similar.rb
arel_toolkit-0.4.2 lib/arel/extensions/similar.rb
arel_toolkit-0.4.1 lib/arel/extensions/similar.rb
arel_toolkit-0.4.0 lib/arel/extensions/similar.rb
arel_toolkit-0.3.0 lib/arel/extensions/similar.rb
arel_toolkit-0.2.0 lib/arel/extensions/similar.rb