I know that if I name the column in the table "othertablename_id", then the rails will know whether to use this column for sort_to or another relation. If I want to have multiple identifiers from the same table, obviously this will not work, because I will have duplicate column names. What is the best way to create a table that joins two rows from one table? As in the table "Purpose", which applies to exactly two users.
I have
belongs_to :user_1, :class_name => "User" belongs_to :user_2, :class_name => "User"
user_1_id user_2_id . , , .
:
Appointment ================= source_user_id object_user_id
?
- 361, :
" "... , . . .
" "
... , . . .
alt text http://img180.imageshack.us/img180/4004/dibujolfa.png
Rails , has_and_belongs_to_many . , "HABTM." " " - "habtm."-- . , . . , , category_products.
Rails , has_and_belongs_to_many . , "HABTM." " " - "habtm."
-- . , . . , , category_products.
, , , , has_and_belongs_to_many.
Source: https://habr.com/ru/post/1748611/More articles:Best practice when updating individual fields in a database record - sqlDynaLoader sees incorrect values ββin @INC - perlHow to find an offensive column? Unable to convert from string to int32 - c #How to show and move the mouse cursor in Powerpoint VBA? - vbaIs my Perl script exciting environment variables from somewhere else? - perlPHP - Which is faster, memcache or required? - phpUsing C # WATIN, how do I get the value of the html element of an INPUT tag? - c #hierarchical clustering with gene expression matrix in python - pythonhttps://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1748615/macros-to-set-and-clear-bits&usg=ALkJrhh77ZmU9Uwd2EM6Rhas-keNkFvkNgC # using statement placement - c #All Articles