Sha256: 2b0606b24ae56fef1f562e50a976b18be581f9747db014f2d0bafbd478716685

Contents?: true

Size: 770 Bytes

Versions: 15

Compression:

Stored size: 770 Bytes

Contents

module Arel
  module Visitors
    class PostgreSQL < Arel::Visitors::ToSql
      private

      def visit_Arel_Nodes_Matches o, collector
        infix_value o, collector, ' ILIKE '
      end

      def visit_Arel_Nodes_DoesNotMatch o, collector
        infix_value o, collector, ' NOT ILIKE '
      end

      def visit_Arel_Nodes_Regexp o, collector
        infix_value o, collector, ' ~ '
      end

      def visit_Arel_Nodes_NotRegexp o, collector
        infix_value o, collector, ' !~ '
      end

      def visit_Arel_Nodes_DistinctOn o, collector
        collector << "DISTINCT ON ( "
        visit(o.expr, collector) << " )"
      end

      def visit_Arel_Nodes_BindParam o, collector
        collector.add_bind(o) { |i| "$#{i}" }
      end
    end
  end
end

Version data entries

15 entries across 15 versions & 7 rubygems

Version Path
enju_leaf-1.2.1 vendor/bundle/ruby/2.3/gems/arel-6.0.4/lib/arel/visitors/postgresql.rb
arel-6.0.4 lib/arel/visitors/postgresql.rb
ish_lib_manager-0.0.1 test/dummy/vendor/bundle/ruby/2.3.0/gems/arel-6.0.3/lib/arel/visitors/postgresql.rb
angular-rails4-templates-0.4.1 vendor/ruby/2.1.0/gems/arel-6.0.3/lib/arel/visitors/postgresql.rb
angular-rails4-templates-0.4.0 vendor/ruby/2.1.0/gems/arel-6.0.3/lib/arel/visitors/postgresql.rb
angular-rails4-templates-0.3.0 vendor/ruby/2.1.0/gems/arel-6.0.3/lib/arel/visitors/postgresql.rb
sc_core-0.0.7 test/dummy/vendor/bundle/ruby/2.2.0/gems/arel-6.0.3/lib/arel/visitors/postgresql.rb
arel-6.0.3 lib/arel/visitors/postgresql.rb
solidus_backend-1.0.0.pre3 vendor/bundle/gems/arel-6.0.0/lib/arel/visitors/postgresql.rb
solidus_backend-1.0.0.pre2 vendor/bundle/gems/arel-6.0.0/lib/arel/visitors/postgresql.rb
arel-6.0.2 lib/arel/visitors/postgresql.rb
arel-6.0.1 lib/arel/visitors/postgresql.rb
solidus_backend-1.0.0.pre vendor/bundle/gems/arel-6.0.0/lib/arel/visitors/postgresql.rb
shoppe-paypal-1.1.0 vendor/bundle/ruby/2.1.0/gems/arel-6.0.0/lib/arel/visitors/postgresql.rb
arel-6.0.0 lib/arel/visitors/postgresql.rb