diff options
author | Pratik Naik <pratiknaik@gmail.com> | 2010-01-12 22:37:26 +0530 |
---|---|---|
committer | Pratik Naik <pratiknaik@gmail.com> | 2010-01-12 22:37:26 +0530 |
commit | 4938a5746ddd3527c119d946e638505d32a6416f (patch) | |
tree | b88a2e102df111cebf96b7ee53dbfdea82d85408 /activerecord/lib | |
parent | a04486dc997979a2d87fc013d30b6e71a3df4a64 (diff) | |
download | rails-4938a5746ddd3527c119d946e638505d32a6416f.tar.gz rails-4938a5746ddd3527c119d946e638505d32a6416f.tar.bz2 rails-4938a5746ddd3527c119d946e638505d32a6416f.zip |
Ensure using proper engine for Arel::Table
Diffstat (limited to 'activerecord/lib')
-rwxr-xr-x | activerecord/lib/active_record/associations.rb | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/activerecord/lib/active_record/associations.rb b/activerecord/lib/active_record/associations.rb index d748500340..50fd4aafec 100755 --- a/activerecord/lib/active_record/associations.rb +++ b/activerecord/lib/active_record/associations.rb @@ -1955,7 +1955,7 @@ module ActiveRecord 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 @@ module ActiveRecord 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 |