aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--activerecord/lib/active_record/core.rb2
-rw-r--r--activerecord/lib/active_record/relation/predicate_builder.rb4
-rw-r--r--activerecord/lib/active_record/relation/query_methods.rb2
-rw-r--r--activerecord/lib/active_record/sanitization.rb2
4 files changed, 5 insertions, 5 deletions
diff --git a/activerecord/lib/active_record/core.rb b/activerecord/lib/active_record/core.rb
index 89d8932e9e..c812e7842a 100644
--- a/activerecord/lib/active_record/core.rb
+++ b/activerecord/lib/active_record/core.rb
@@ -235,7 +235,7 @@ module ActiveRecord
# scope :published_and_commented, -> { published.and(self.arel_table[:comments_count].gt(0)) }
# end
def arel_table # :nodoc:
- @arel_table ||= Arel::Table.new(table_name, arel_engine)
+ @arel_table ||= Arel::Table.new(table_name)
end
# Returns the Arel engine.
diff --git a/activerecord/lib/active_record/relation/predicate_builder.rb b/activerecord/lib/active_record/relation/predicate_builder.rb
index e4b6b49087..938bf55c6d 100644
--- a/activerecord/lib/active_record/relation/predicate_builder.rb
+++ b/activerecord/lib/active_record/relation/predicate_builder.rb
@@ -25,7 +25,7 @@ module ActiveRecord
if value.empty?
queries << '1=0'
else
- table = Arel::Table.new(column, default_table.engine)
+ table = Arel::Table.new(column)
association = klass._reflect_on_association(column)
value.each do |k, v|
@@ -37,7 +37,7 @@ module ActiveRecord
if column.include?('.')
table_name, column = column.split('.', 2)
- table = Arel::Table.new(table_name, default_table.engine)
+ table = Arel::Table.new(table_name)
end
queries.concat expand(klass, table, column, value)
diff --git a/activerecord/lib/active_record/relation/query_methods.rb b/activerecord/lib/active_record/relation/query_methods.rb
index 6e384facce..0edd2b1e48 100644
--- a/activerecord/lib/active_record/relation/query_methods.rb
+++ b/activerecord/lib/active_record/relation/query_methods.rb
@@ -858,7 +858,7 @@ module ActiveRecord
private
def build_arel
- arel = Arel::SelectManager.new(table.engine, table)
+ arel = Arel::SelectManager.new(klass.arel_engine, table)
build_joins(arel, joins_values.flatten) unless joins_values.empty?
diff --git a/activerecord/lib/active_record/sanitization.rb b/activerecord/lib/active_record/sanitization.rb
index 6a130c145b..88dfddebcc 100644
--- a/activerecord/lib/active_record/sanitization.rb
+++ b/activerecord/lib/active_record/sanitization.rb
@@ -93,7 +93,7 @@ sanitize_sql_hash_for_conditions is deprecated, and will be removed in Rails 5.0
attrs = PredicateBuilder.resolve_column_aliases self, attrs
attrs = expand_hash_conditions_for_aggregates(attrs)
- table = Arel::Table.new(table_name, arel_engine).alias(default_table_name)
+ table = Arel::Table.new(table_name).alias(default_table_name)
PredicateBuilder.build_from_hash(self, attrs, table).map { |b|
connection.visitor.compile b
}.join(' AND ')