C
C
Ciscoridze2016-03-22 19:39:25
Ruby on Rails
Ciscoridze, 2016-03-22 19:39:25

Which Active Record link should I choose in my case?

I am developing an educational application like Toster. There are questions, for every question there are answers, for every answer there is an author.
How to make associations in this case?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Mike Butlitsky, 2016-03-22
@goodprogrammer

[Question] belongs_to [Author (user)]
[Question] has_many [Answers]
[Answer] belongs_to [Author (user)]
In my opinion everything is straightforward, if there are no special requirements.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question