1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Merge pull request #24634 from kamipo/arel_visitors_definitions_was_removed

Define `arel_visitor` method on all adapters
This commit is contained in:
Rafael França 2016-04-19 13:33:01 -03:00
commit 406a2380b8
4 changed files with 13 additions and 1 deletions

View file

@ -149,7 +149,7 @@ module ActiveRecord
end
def arel_visitor # :nodoc:
(Arel::Visitors::VISITORS[@config[:adapter]] || Arel::Visitors::ToSql).new(self)
Arel::Visitors::ToSql.new(self)
end
def valid_type?(type)

View file

@ -24,6 +24,10 @@ module ActiveRecord
MySQL::SchemaCreation.new(self)
end
def arel_visitor # :nodoc:
Arel::Visitors::MySQL.new(self)
end
##
# :singleton-method:
# By default, the Mysql2Adapter will consider all columns of type <tt>tinyint(1)</tt>

View file

@ -125,6 +125,10 @@ module ActiveRecord
PostgreSQL::SchemaCreation.new self
end
def arel_visitor # :nodoc:
Arel::Visitors::PostgreSQL.new(self)
end
# Returns true, since this connection adapter supports prepared statement
# caching.
def supports_statement_cache?

View file

@ -80,6 +80,10 @@ module ActiveRecord
SQLite3::SchemaCreation.new self
end
def arel_visitor # :nodoc:
Arel::Visitors::SQLite.new(self)
end
def initialize(connection, logger, connection_options, config)
super(connection, logger, config)