Ask A Question

Notifications

You’re not receiving notifications from this thread.

How do I have 2 users associated with a model

dwedigital asked in Databases

I have a model that I want 2 users to have an association with. So this model would have a proposer (user) and a challenger (a different user). I am getting a bit tied up in spaghetti around whether this is a has_and_belongs_to_many relationship or I also saw a pattern where you can state belongs_to :proposer, class 'User'

I am relatively new to rails so apolgies if a stupid question!

Reply
Join the discussion
Create an account Log in

Want to stay up-to-date with Ruby on Rails?

Join 82,584+ developers who get early access to new tutorials, screencasts, articles, and more.

    We care about the protection of your data. Read our Privacy Policy.