Answer the question
In order to leave comments, you need to log in
How to properly bind models via includes in rails5?
Hello! Which day I can not solve the problem with ORM. There are 2 models: clients, contacts, connected through the 3rd - workplace. In the controller I try to select all clients and their contacts through includes and nothing happens. it is clear from the request that the orm goes to the workplace model and selects everything that is needed, but it does not communicate with the contact model in any way. Help! In the old manner, I remembered that in yii2 and in laravel it was enough to write through ->with('contacts') and the orm built queries with 3 models. just in case, he showed how I go through the counterparties in the
GIT view
Answer the question
In order to leave comments, you need to log in
And it doesn't throw any error? In order("ClientName ASC"), in my opinion, the table should also be specified, and references may need to be added . And .all is not needed there.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question