Use the inflector rules made for the purpose

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2186 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
This commit is contained in:
David Heinemeier Hansson 2005-09-11 06:25:09 +00:00
parent fe4abaa7df
commit 3e00e1a297

@ -4,7 +4,7 @@ class HasAndBelongsToManyAssociation < AssociationCollection #:nodoc:
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]