Permalink
Browse files

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
  • Loading branch information...
1 parent f22f352 commit 6c67905c1c1acdb88b55fdc074399aecc6835d41 @dhh dhh committed Mar 18, 2006
Showing with 3 additions and 1 deletion.
  1. +2 −0 activerecord/CHANGELOG
  2. +1 −1 activerecord/lib/active_record/associations.rb
View
@@ -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
""

0 comments on commit 6c67905

Please sign in to comment.