diff options
author | Xavier Noria <fxn@hashref.com> | 2008-08-19 16:25:31 +0200 |
---|---|---|
committer | Xavier Noria <fxn@hashref.com> | 2008-08-19 16:25:31 +0200 |
commit | 2009fb52061aca32c318dfa91d4fa5b59eb095c7 (patch) | |
tree | 20c0ceb21b98c90e11ba8772bf276715af73eab3 | |
parent | 03819e0a5a31a55467ddfdfccd75486d7583978e (diff) | |
download | rails-2009fb52061aca32c318dfa91d4fa5b59eb095c7.tar.gz rails-2009fb52061aca32c318dfa91d4fa5b59eb095c7.tar.bz2 rails-2009fb52061aca32c318dfa91d4fa5b59eb095c7.zip |
revised rdoc of join_table_name
-rw-r--r-- | activerecord/lib/active_record/associations.rb | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/activerecord/lib/active_record/associations.rb b/activerecord/lib/active_record/associations.rb index 4e33dfe69f..8129d571a6 100644 --- a/activerecord/lib/active_record/associations.rb +++ b/activerecord/lib/active_record/associations.rb @@ -1220,12 +1220,11 @@ module ActiveRecord end private - # Generate a join table name from two provided tables names. - # The order of names in join name is determined by lexical precedence. - # join_table_name("members", "clubs") - # => "clubs_members" - # join_table_name("members", "special_clubs") - # => "members_special_clubs" + # Generates a join table name from two provided table names. + # The names in the join table namesme end up in lexicographic order. + # + # join_table_name("members", "clubs") # => "clubs_members" + # join_table_name("members", "special_clubs") # => "members_special_clubs" def join_table_name(first_table_name, second_table_name) if first_table_name < second_table_name join_table = "#{first_table_name}_#{second_table_name}" |