123456789_123456789_123456789_123456789_123456789_

Module: ActiveRecord::ConnectionAdapters::DetermineIfPreparableVisitor

Instance Attribute Summary

Instance Method Summary

Instance Attribute Details

#preparable (rw)

[ GitHub ]

  
# File 'activerecord/lib/active_record/connection_adapters/determine_if_preparable_visitor.rb', line 6

attr_accessor :preparable

Instance Method Details

#accept

[ GitHub ]

  
# File 'activerecord/lib/active_record/connection_adapters/determine_if_preparable_visitor.rb', line 8

def accept(*)
  @preparable = true
  super
end

#visit_Arel_Nodes_In(o, collector)

[ GitHub ]

  
# File 'activerecord/lib/active_record/connection_adapters/determine_if_preparable_visitor.rb', line 13

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

#visit_Arel_Nodes_SqlLiteral

[ GitHub ]

  
# File 'activerecord/lib/active_record/connection_adapters/determine_if_preparable_visitor.rb', line 27

def visit_Arel_Nodes_SqlLiteral(*)
  @preparable = false
  super
end