If I have two models – parent and child, and parent has_many children, and I have an array of parents and want to retrieve all of the children for all of those parents, is there a way I can do this in Rails without writing the SQL statement manually?
This is what I want to do:
@parents = Parent.where("[various conditions]")
@children = @parents.children
or
or u can use join