Returns a visitor instance for this adaptor, which conforms to the
Arel::ToSql interface
# File activerecord/lib/active_record/connection_adapters/abstract_adapter.rb, line 54
def self.visitor_for(pool) # :nodoc:
adapter = pool.spec.config[:adapter]
if Arel::Visitors::VISITORS[adapter]
ActiveSupport::Deprecation.warn(
"Arel::Visitors::VISITORS is deprecated and will be removed. Database adapters " "should define a visitor_for method which returns the appropriate visitor for " "the database. For example, MysqlAdapter.visitor_for(pool) returns " "Arel::Visitors::MySQL.new(pool)."
)
Arel::Visitors::VISITORS[adapter].new(pool)
else
Arel::Visitors::ToSql.new(pool)
end
end