aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRafael França <rafaelmfranca@gmail.com>2016-04-19 13:33:01 -0300
committerRafael França <rafaelmfranca@gmail.com>2016-04-19 13:33:01 -0300
commit406a2380b88714387e015efcc0696bd2b20f49f1 (patch)
tree78122686680cca5e031cea50b52c5c14c55a94da
parent18f02375e7b48497fd412cff3ee44d3e0b69590b (diff)
parentdd58c3bf23ded02a2d8fbf7a20f577486b8cba9f (diff)
downloadrails-406a2380b88714387e015efcc0696bd2b20f49f1.tar.gz
rails-406a2380b88714387e015efcc0696bd2b20f49f1.tar.bz2
rails-406a2380b88714387e015efcc0696bd2b20f49f1.zip
Merge pull request #24634 from kamipo/arel_visitors_definitions_was_removed
Define `arel_visitor` method on all adapters
-rw-r--r--activerecord/lib/active_record/connection_adapters/abstract_adapter.rb2
-rw-r--r--activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb4
-rw-r--r--activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb4
-rw-r--r--activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb4
4 files changed, 13 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb b/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb
index 7276b8de44..20cc205b0d 100644
--- a/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb
+++ b/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb
@@ -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)
diff --git a/activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb b/activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb
index 5125a0f06e..64070f0e6c 100644
--- a/activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb
+++ b/activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb
@@ -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>
diff --git a/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb b/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb
index a052b33627..470e03b0ed 100644
--- a/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb
+++ b/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb
@@ -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?
diff --git a/activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb b/activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb
index 4e5d9e65ec..985cc06aa0 100644
--- a/activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb
+++ b/activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb
@@ -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)