diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2005-12-11 18:06:51 +0000 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2005-12-11 18:06:51 +0000 |
commit | 6427db6baa9cfd3dfdbe8c1efd4e99825f751023 (patch) | |
tree | 760de7de653b93930432466ab84eeb5554ceb01a /activerecord/lib/active_record/associations | |
parent | a501aa75cd6657b9faa2aed2137501ec0efa3e8a (diff) | |
download | rails-6427db6baa9cfd3dfdbe8c1efd4e99825f751023.tar.gz rails-6427db6baa9cfd3dfdbe8c1efd4e99825f751023.tar.bz2 rails-6427db6baa9cfd3dfdbe8c1efd4e99825f751023.zip |
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
Diffstat (limited to 'activerecord/lib/active_record/associations')
-rw-r--r-- | activerecord/lib/active_record/associations/has_many_through_association.rb | 2 |
1 files changed, 1 insertions, 1 deletions
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] |