ruby - Set-up Many-to-Many in Rails with destroy allowed for only one of the many -
I am trying to prepare a very simple system, but the railroad way to do this is to save me. There should be two institutions, one user and one son, one condition has two users and the user has many bets. I want to make this condition to be a user so that it can be solved (in any form of update) or remove it . In my initial thinking, there are two ways for a user, one can be the best choice of many associations in the rail as a better response or, keeping in mind that who is the owner of the model. But, then you are repeating the User ID twice. Thank you in advance! I think you want this: class users I am (beta,: foreign_kys => gt; bettor_id ',: class_name = & gt;' bet ') - medium (: responses, alien_key =>; responder_id' ',: class_name = (Bettor ,: class_name = & gt; 'user')) related_ to (: responder, class_name = & gt; 'user') end