Sha256: 73e415528f29aa48d01424b2df276a0ece64440dd059266e453ca66a10810f11

Contents?: true

Size: 577 Bytes

Versions: 17

Compression:

Stored size: 577 Bytes

Contents

# frozen_string_literal: true

module Arel # :nodoc: all
  module Visitors
    class WhereSql < Arel::Visitors::ToSql
      def initialize(inner_visitor, *args, &block)
        @inner_visitor = inner_visitor
        super(*args, &block)
      end

      private

        def visit_Arel_Nodes_SelectCore(o, collector)
          collector << "WHERE "
          wheres = o.wheres.map do |where|
            Nodes::SqlLiteral.new(@inner_visitor.accept(where, collector.class.new).value)
          end

          inject_join wheres, collector, " AND "
        end
    end
  end
end

Version data entries

17 entries across 17 versions & 4 rubygems

Version Path
activerecord-6.0.2.2 lib/arel/visitors/where_sql.rb
argon-1.3.1 vendor/bundle/ruby/2.7.0/gems/activerecord-6.0.2.1/lib/arel/visitors/where_sql.rb
symbolic_enum-1.1.5 vendor/bundle/ruby/2.7.0/gems/activerecord-6.0.2.1/lib/arel/visitors/where_sql.rb
activerecord-6.0.2.1 lib/arel/visitors/where_sql.rb
activerecord-6.0.2 lib/arel/visitors/where_sql.rb
activerecord-6.0.2.rc2 lib/arel/visitors/where_sql.rb
activerecord-6.0.2.rc1 lib/arel/visitors/where_sql.rb
activerecord-6.0.1 lib/arel/visitors/where_sql.rb
chatops-rpc-0.0.2 fixtures/chatops-controller-example/vendor/bundle/ruby/2.5.0/gems/activerecord-6.0.0/lib/arel/visitors/where_sql.rb
activerecord-6.0.1.rc1 lib/arel/visitors/where_sql.rb
chatops-rpc-0.0.1 fixtures/chatops-controller-example/vendor/bundle/ruby/2.5.0/gems/activerecord-6.0.0/lib/arel/visitors/where_sql.rb
activerecord-6.0.0 lib/arel/visitors/where_sql.rb
activerecord-6.0.0.rc2 lib/arel/visitors/where_sql.rb
activerecord-6.0.0.rc1 lib/arel/visitors/where_sql.rb
activerecord-6.0.0.beta3 lib/arel/visitors/where_sql.rb
activerecord-6.0.0.beta2 lib/arel/visitors/where_sql.rb
activerecord-6.0.0.beta1 lib/arel/visitors/where_sql.rb