0

Hay guys, I'm a novice to intermediate RoR programmer. However, I'm not too good on setting up relational database's so i need a hand.

Basically my app is a book club. A user signs up, the user creates a book club based on a book. Other users joins this club and discusses it (like a forum).

I have written a english description of the schema.

User has many clubs

Club has one book, has many users, has many threads

Book has many clubs, belongs to a club

Threads has many replies, belongs to a club

Reply belongs to a thread

I need some help with the migrations for this, aswell as the models.

Any help would be great.

Thanks!

1 Answer 1

6

This is one of the best descriptions of Active Record associations I've seen:

http://guides.rubyonrails.org/association_basics.html

Go through these and you'll see how to setup your models and migrations.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.