Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Ensure using proper engine for Arel::Table

  • Loading branch information...
commit 4938a5746ddd3527c119d946e638505d32a6416f 1 parent a04486d
@lifo lifo authored
Showing with 4 additions and 4 deletions.
  1. +4 −4 activerecord/lib/active_record/associations.rb
View
8 activerecord/lib/active_record/associations.rb
@@ -1955,7 +1955,7 @@ def set_target_and_inverse(join, association, record)
class JoinBase # :nodoc:
attr_reader :active_record, :table_joins
- delegate :table_name, :column_names, :primary_key, :reflections, :sanitize_sql, :to => :active_record
+ delegate :table_name, :column_names, :primary_key, :reflections, :sanitize_sql, :active_relation_engine, :to => :active_record
def initialize(active_record, joins = nil)
@active_record = active_record
@@ -2148,12 +2148,12 @@ def association_join
end
def relation
- aliased = Arel::Table.new(table_name, :as => @aliased_table_name)
+ aliased = Arel::Table.new(table_name, :as => @aliased_table_name, :engine => active_relation_engine)
if reflection.macro == :has_and_belongs_to_many
- [Arel::Table.new(options[:join_table], :as => aliased_join_table_name), aliased]
+ [Arel::Table.new(options[:join_table], :as => aliased_join_table_name, :engine => active_relation_engine), aliased]
elsif reflection.options[:through]
- [Arel::Table.new(through_reflection.klass.table_name, :as => aliased_join_table_name), aliased]
+ [Arel::Table.new(through_reflection.klass.table_name, :as => aliased_join_table_name, :engine => active_relation_engine), aliased]
else
aliased
end
Please sign in to comment.
Something went wrong with that request. Please try again.