Let me display a sketch of needed models:
1) I’ve a Unit model
it’s connected (has a foreign key) to the Type model. has_many :People
2)Type – it’s a simple model, a string ‘name’ – like (‘first’,’second’, etc)
3) Person model – just a person.
What i need to do’s output:
each type with all the units, each with all the people of this unit
OR
How can i access unit’s type via person record?
So, i’ve solved this problem.
The query goes something like this:
Sorry if i didn’t describe the question properly.