Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Define arel_visitor method on all adapters #24634

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ def collector
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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ def schema_creation
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>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,10 @@ def schema_creation # :nodoc:
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?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,10 @@ def schema_creation # :nodoc:
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)

Expand Down