diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2006-03-18 20:20:30 +0000 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2006-03-18 20:20:30 +0000 |
commit | 6c67905c1c1acdb88b55fdc074399aecc6835d41 (patch) | |
tree | d494915fcfa5f04a09122a459ec3dbcb286f6e7d | |
parent | f22f352ee3316a6f8da4b19e816802bc8d371db6 (diff) | |
download | rails-6c67905c1c1acdb88b55fdc074399aecc6835d41.tar.gz rails-6c67905c1c1acdb88b55fdc074399aecc6835d41.tar.bz2 rails-6c67905c1c1acdb88b55fdc074399aecc6835d41.zip |
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
-rw-r--r-- | activerecord/CHANGELOG | 2 | ||||
-rwxr-xr-x | activerecord/lib/active_record/associations.rb | 2 |
2 files changed, 3 insertions, 1 deletions
diff --git a/activerecord/CHANGELOG b/activerecord/CHANGELOG index 4e6ee6e216..0aa7c42f1d 100644 --- a/activerecord/CHANGELOG +++ b/activerecord/CHANGELOG @@ -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>] diff --git a/activerecord/lib/active_record/associations.rb b/activerecord/lib/active_record/associations.rb index a982279b03..94af33d777 100755 --- a/activerecord/lib/active_record/associations.rb +++ b/activerecord/lib/active_record/associations.rb @@ -1287,7 +1287,7 @@ module ActiveRecord 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 "" |