Let’s say I have the following hierarchy of tables:
Group <- parent
Location <- child of Group
School <- child of Location
Phone <- child of School
Then, if I want to do this:
Location.find(…someparms…, :include => [:schools, :group, :phones])
I get an association error (Association was not found). I guess it
happens because AR is looking in the Location model for the Phones
association, which only exists in the School model (I also tried
Is there any way I can load all Phone records at once? I wouldn’t mind
using custom SQL if that’s the only solution.
Thanks in advance!
PS: Merrrrry christmas!