From 6427db6baa9cfd3dfdbe8c1efd4e99825f751023 Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Sun, 11 Dec 2005 18:06:51 +0000 Subject: Added tests for join models and fixed a bug #3177 git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3279 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- .../lib/active_record/associations/has_many_through_association.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'activerecord/lib/active_record/associations/has_many_through_association.rb') diff --git a/activerecord/lib/active_record/associations/has_many_through_association.rb b/activerecord/lib/active_record/associations/has_many_through_association.rb index f9020ebcad..9ecd6f059e 100644 --- a/activerecord/lib/active_record/associations/has_many_through_association.rb +++ b/activerecord/lib/active_record/associations/has_many_through_association.rb @@ -58,7 +58,7 @@ module ActiveRecord else conditions = "#{@reflection.klass.table_name}.#{@reflection.klass.primary_key} = #{through_reflection.table_name}.#{@reflection.klass.to_s.foreign_key} " + - "AND #{through_reflection.table_name}.#{@owner.to_s.foreign_key} = #{@owner.quoted_id}" + "AND #{through_reflection.table_name}.#{@owner.class.to_s.foreign_key} = #{@owner.quoted_id}" end conditions << " AND (#{interpolate_sql(sanitize_sql(@reflection.options[:conditions]))})" if @reflection.options[:conditions] -- cgit v1.2.3