Fixed that eager loading from belongs_to would cause the association to be double-singularized (closes #4117) [jonathan@bluewire.net.nz]

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3940 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
This commit is contained in:
David Heinemeier Hansson 2006-03-18 20:20:30 +00:00
parent f22f352ee3
commit 6c67905c1c
2 changed files with 3 additions and 1 deletions

@ -143,6 +143,8 @@
* Stop the MySQL adapter crashing when views are present. #3782 [Jonathan Viney]
* Don't classify the belongs_to class, it is already singular #4117 [keithm@infused.org]
* Allow set_fixture_class to take Classes instead of strings for a class in a module. Raise FixtureClassNotFound if a fixture can't load. [Rick Olson]
* Fix quoting of inheritance column for STI eager loading #4098 [Jonathan Viney <jonathan@bluewire.net.nz>]

@ -1287,7 +1287,7 @@ def association_join
when :belongs_to
" LEFT OUTER JOIN %s ON %s.%s = %s.%s " % [
table_name_and_alias, aliased_table_name, reflection.klass.primary_key,
parent.aliased_table_name, options[:foreign_key] || klass.to_s.classify.foreign_key
parent.aliased_table_name, options[:foreign_key] || klass.to_s.foreign_key
]
else
""