Yesterday found an interesting issue in scope method.
Let`s say, you have next model structure:
Model A --has_many-> Model B --has_many-> Model C --has_many-> Model_D
Model D has some attribute, let`s say, 'status' ENUM('opened',
In Model A I would like to take all records, where Model D`s status is
This is a little bit confusing.
Here is an example.
We have a project. A project has many tasklists. Tasklist has many
I would like take all projects, which have one or more tasks opened.
I hope, there should be any possibility to call in controller just
active_projects = Project.all.active.
I would appreciate any help.