Forum: Ruby on Rails HABTM or has_many through

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
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
This topic is locked and can not be replied to.