diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2005-06-26 04:49:52 +0000 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2005-06-26 04:49:52 +0000 |
commit | 1bb676b6c0fd5f181e1b0b155be6bc6ffeb67d02 (patch) | |
tree | 7cfda5455d79c0409d3807177382d70358d78e5c /activerecord/lib/active_record/associations.rb | |
parent | e15207f497f5ea8fca25686303b5ef3a068b2ea9 (diff) | |
download | rails-1bb676b6c0fd5f181e1b0b155be6bc6ffeb67d02.tar.gz rails-1bb676b6c0fd5f181e1b0b155be6bc6ffeb67d02.tar.bz2 rails-1bb676b6c0fd5f181e1b0b155be6bc6ffeb67d02.zip |
Fixed problem with eager loading when using a has_and_belongs_to_many association using :association_foreign_key #1504 [flash@vanklinkenbergsoftware.nl]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1516 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activerecord/lib/active_record/associations.rb')
-rwxr-xr-x | activerecord/lib/active_record/associations.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/associations.rb b/activerecord/lib/active_record/associations.rb index 3fbe252144..9dba33dfd9 100755 --- a/activerecord/lib/active_record/associations.rb +++ b/activerecord/lib/active_record/associations.rb @@ -809,7 +809,7 @@ module ActiveRecord "#{reflection.options[:join_table]}.#{reflection.options[:foreign_key] || table_name.classify.foreign_key} = " + "#{table_name}.#{primary_key} " + " LEFT OUTER JOIN #{reflection.klass.table_name} ON " + - "#{reflection.options[:join_table]}.#{reflection.options[:associated_foreign_key] || reflection.klass.table_name.classify.foreign_key} = " + + "#{reflection.options[:join_table]}.#{reflection.options[:association_foreign_key] || reflection.klass.table_name.classify.foreign_key} = " + "#{reflection.klass.table_name}.#{reflection.klass.primary_key} " when :has_many, :has_one " LEFT OUTER JOIN #{reflection.klass.table_name} ON " + |