aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2004-12-07 12:33:42 +0000
committerDavid Heinemeier Hansson <david@loudthinking.com>2004-12-07 12:33:42 +0000
commit8a40c6b52258df9f790fd160104c3ab18e0494e7 (patch)
treed239ee6f131f984e689d5c5b15c9c2fade14d5df /activerecord/lib
parentea759cb76161a7a0003c3cd3b38a8a125a99af3c (diff)
downloadrails-8a40c6b52258df9f790fd160104c3ab18e0494e7.tar.gz
rails-8a40c6b52258df9f790fd160104c3ab18e0494e7.tar.bz2
rails-8a40c6b52258df9f790fd160104c3ab18e0494e7.zip
Fixed has_and_belongs_to_many guessing of foreign key so that keys are generated correctly for models like SomeVerySpecialClient [Florian Weber]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@69 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activerecord/lib')
-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 fd36352deb..8dec71403c 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, join_table, options)
super(owner, association_name, association_class_name, association_class_primary_key_name, options)
- @association_foreign_key = options[:association_foreign_key] || Inflector.underscore(Inflector.demodulize(association_class_name.downcase)) + "_id"
+ @association_foreign_key = options[:association_foreign_key] || Inflector.underscore(Inflector.demodulize(association_class_name)) + "_id"
association_table_name = options[:table_name] || @association_class.table_name(association_class_name)
@join_table = join_table
@order = options[:order] || "t.#{@owner.class.primary_key}"