mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
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
This commit is contained in:
parent
ea759cb761
commit
8a40c6b522
2 changed files with 4 additions and 1 deletions
|
@ -1,5 +1,8 @@
|
|||
*CVS*
|
||||
|
||||
* Fixed has_and_belongs_to_many guessing of foreign key so that keys are generated correctly for models like SomeVerySpecialClient
|
||||
[Florian Weber]
|
||||
|
||||
* Added counter_sql option for has_many associations [bitsweat]. Documentation:
|
||||
|
||||
<tt>:counter_sql</tt> - specify a complete SQL statement to fetch the size of the association. If +:finder_sql+ is
|
||||
|
|
|
@ -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}"
|
||||
|
|
Loading…
Reference in a new issue