Sha256: ef2d19b6fa76af8956923be21442e0afe2c6cfd99af847989dc3da4212711c5a

Contents?: true

Size: 763 Bytes

Versions: 5

Compression:

Stored size: 763 Bytes

Contents

module Torque
  module PostgreSQL
    module Arel
      module Visitors

        # Enclose select manager with parenthesis
        # :TODO: Remove when checking the new version of Arel
        def visit_Arel_SelectManager o, collector
          collector << '('
          visit(o.ast, collector) << ')'
        end

        # Add ONLY modifier to query
        def visit_Arel_Nodes_JoinSource(o, collector)
          collector << 'ONLY ' if o.only?
          super
        end

        # Add USING modifier to query
        def visit_Torque_PostgreSQL_Arel_Using(o, collector)
          collector << 'USING ( '
          collector << o.expr
          collector << ' )'
        end

      end

      ::Arel::Visitors::PostgreSQL.include Visitors
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
torque-postgresql-0.2.5 lib/torque/postgresql/arel/visitors.rb
torque-postgresql-0.2.4 lib/torque/postgresql/arel/visitors.rb
torque-postgresql-0.2.3 lib/torque/postgresql/arel/visitors.rb
torque-postgresql-0.2.2 lib/torque/postgresql/arel/visitors.rb
torque-postgresql-0.2.1 lib/torque/postgresql/arel/visitors.rb