Sha256: e31a6adbb7814e27908f827d28d301ad94d70fc3287c4356c219b844581b6f47

Contents?: true

Size: 687 Bytes

Versions: 4

Compression:

Stored size: 687 Bytes

Contents

# frozen_string_literal: true

module ActiveRecord
  module ConnectionAdapters
    module DetermineIfPreparableVisitor
      attr_reader :preparable

      def accept(*)
        @preparable = true
        super
      end

      def visit_Arel_Nodes_In(o, collector)
        @preparable = false

        if Array === o.right && !o.right.empty?
          o.right.delete_if do |bind|
            if Arel::Nodes::BindParam === bind && Relation::QueryAttribute === bind.value
              !bind.value.boundable?
            end
          end
        end

        super
      end

      def visit_Arel_Nodes_SqlLiteral(*)
        @preparable = false
        super
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 2 rubygems

Version Path
activerecord-5.2.2.1 lib/active_record/connection_adapters/determine_if_preparable_visitor.rb
nullifyable-0.1.0 vendor/bundle/gems/activerecord-5.2.2/lib/active_record/connection_adapters/determine_if_preparable_visitor.rb
activerecord-5.2.2 lib/active_record/connection_adapters/determine_if_preparable_visitor.rb
activerecord-5.2.2.rc1 lib/active_record/connection_adapters/determine_if_preparable_visitor.rb