aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2005-09-11 06:25:09 +0000
committerDavid Heinemeier Hansson <david@loudthinking.com>2005-09-11 06:25:09 +0000
commit3e00e1a297b70a6ae6e8ac3971ab2d49b6e01666 (patch)
tree1f0a843af8368181081668f666f6e73d2f686159
parentfe4abaa7df98aa736485b6ac863d05d80d2c1d89 (diff)
downloadrails-3e00e1a297b70a6ae6e8ac3971ab2d49b6e01666.tar.gz
rails-3e00e1a297b70a6ae6e8ac3971ab2d49b6e01666.tar.bz2
rails-3e00e1a297b70a6ae6e8ac3971ab2d49b6e01666.zip
Use the inflector rules made for the purpose
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2186 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
-rw-r--r--activerecord/lib/active_record/associations/has_and_belongs_to_many_association.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/associations/has_and_belongs_to_many_association.rb b/activerecord/lib/active_record/associations/has_and_belongs_to_many_association.rb
index c4eead0e56..d08e47378f 100644
--- a/activerecord/lib/active_record/associations/has_and_belongs_to_many_association.rb
+++ b/activerecord/lib/active_record/associations/has_and_belongs_to_many_association.rb
@@ -4,7 +4,7 @@ module ActiveRecord
def initialize(owner, association_name, association_class_name, association_class_primary_key_name, options)
super
- @association_foreign_key = options[:association_foreign_key] || Inflector.underscore(Inflector.demodulize(association_class_name)) + "_id"
+ @association_foreign_key = options[:association_foreign_key] || association_class_name.foreign_key
@association_table_name = options[:table_name] || @association_class.table_name
@join_table = options[:join_table]
@order = options[:order]