Forum: Ruby on Rails HABTM or has_many through

2cc9feaac138b891ae74e9fa559b34dc?d=identicon&s=25 John Sanderbeck (jsanderbeck)
on 2017-01-07 21:54
I am working on an application that has the following tables:

District
Building
User
Role

What I am trying to accomplish is:

There are many buildings per district
There are many users per district
There are many users per building
Each user has one role per building
Each user has one role per district

I am still learning rails so I am not sure what is the proper way to
approach this...

Can anyone assist me in the correct way to define this?

John
Please log in before posting. Registration is free and takes only a minute.
Existing account

NEW: Do you have a Google/GoogleMail, Yahoo or Facebook account? No registration required!
Log in with Google account | Log in with Yahoo account | Log in with Facebook account
No account? Register here.