aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCarlos Antonio da Silva <carlosantoniodasilva@gmail.com>2013-03-10 09:30:14 -0700
committerCarlos Antonio da Silva <carlosantoniodasilva@gmail.com>2013-03-10 09:30:14 -0700
commit5522fd9bd8a1efd79cb2f48c712fa95092c15907 (patch)
tree644a7c168543b18743e2ba9c07ba34a469fe340d
parentdff4d4ad2b7b55283132eb6cf8ac27b13827624c (diff)
parent12d57cac5fc27dddc5534088cca6bb3133fab5ea (diff)
downloadrails-5522fd9bd8a1efd79cb2f48c712fa95092c15907.tar.gz
rails-5522fd9bd8a1efd79cb2f48c712fa95092c15907.tar.bz2
rails-5522fd9bd8a1efd79cb2f48c712fa95092c15907.zip
Merge pull request #9645 from senny/9643_habtm_wrong_table_name
document habtm join-table name with custom prefix [ci skip]
-rw-r--r--activerecord/lib/active_record/associations.rb2
1 files changed, 2 insertions, 0 deletions
diff --git a/activerecord/lib/active_record/associations.rb b/activerecord/lib/active_record/associations.rb
index 519e9112b8..06da5f2e0d 100644
--- a/activerecord/lib/active_record/associations.rb
+++ b/activerecord/lib/active_record/associations.rb
@@ -1407,6 +1407,8 @@ module ActiveRecord
# to generate a join table name of "papers_paper_boxes" because of the length of the name "paper_boxes",
# but it in fact generates a join table name of "paper_boxes_papers". Be aware of this caveat, and use the
# custom <tt>:join_table</tt> option if you need to.
+ # If your tables share a common prefix, it will only appear once at the beginning. For example,
+ # the tables "catalog_categories" and "catalog_products" generate a join table name of "catalog_categories_products".
#
# The join table should not have a primary key or a model associated with it. You must manually generate the
# join table with a migration such as this: