diff options
author | Jeremy Kemper <jeremy@bitsweat.net> | 2005-09-28 09:14:33 +0000 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2005-09-28 09:14:33 +0000 |
commit | db8f7272292dec7076412d5426847a6e37f66024 (patch) | |
tree | 7380afd6a5a3742620cdab34169b48c7014d26ce /activerecord/lib | |
parent | 981763e53e68eab6b4513383c8cface24ddb1e83 (diff) | |
download | rails-db8f7272292dec7076412d5426847a6e37f66024.tar.gz rails-db8f7272292dec7076412d5426847a6e37f66024.tar.bz2 rails-db8f7272292dec7076412d5426847a6e37f66024.zip |
Ticket #2156 - Use foreign_key inflection uniformly
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2394 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activerecord/lib')
-rwxr-xr-x | activerecord/lib/active_record/associations.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/activerecord/lib/active_record/associations.rb b/activerecord/lib/active_record/associations.rb index dce4f350e8..b1bc5f9a70 100755 --- a/activerecord/lib/active_record/associations.rb +++ b/activerecord/lib/active_record/associations.rb @@ -442,7 +442,7 @@ module ActiveRecord require_association_class(association_class_name) - association_class_primary_key_name = options[:foreign_key] || Inflector.underscore(Inflector.demodulize(association_class_name)) + "_id" + association_class_primary_key_name = options[:foreign_key] || association_class_name.foreign_key association_accessor_methods(association_name, association_class_name, association_class_primary_key_name, options, BelongsToAssociation) association_constructor_method(:build, association_name, association_class_name, association_class_primary_key_name, options, BelongsToAssociation) @@ -599,7 +599,7 @@ module ActiveRecord ) end - primary_key_name = foreign_key || Inflector.underscore(Inflector.demodulize(name)) + "_id" + primary_key_name = foreign_key || name.foreign_key return association_id.id2name, association_class_name, primary_key_name end |