From 41466a4c83e3e590b580d5d2cbc5869e601e7599 Mon Sep 17 00:00:00 2001 From: Rick Olson Date: Tue, 19 Dec 2006 03:10:39 +0000 Subject: fix faulty inheritance tests and that eager loading grabs the wrong inheritance column when the class of your association is an STI subclass. Closes #6859 [protocool] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5744 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- activerecord/lib/active_record/associations.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'activerecord/lib/active_record') diff --git a/activerecord/lib/active_record/associations.rb b/activerecord/lib/active_record/associations.rb index 5c1e796cfd..05eaf7b458 100755 --- a/activerecord/lib/active_record/associations.rb +++ b/activerecord/lib/active_record/associations.rb @@ -1569,7 +1569,7 @@ module ActiveRecord end || '' join << %(AND %s.%s = %s ) % [ aliased_table_name, - reflection.active_record.connection.quote_column_name(reflection.active_record.inheritance_column), + reflection.active_record.connection.quote_column_name(klass.inheritance_column), klass.quote_value(klass.name.demodulize)] unless klass.descends_from_active_record? [through_reflection, reflection].each do |ref| -- cgit v1.2.3