I have this relationship
.
How do I query on ActiveRecord
to return data for Works
, WorkZei
and Wi_schools
?
I've tried it like this:
r = Responsible.find(1)
students = r.students
students.each {|s| s.school.joins(:works,:work_zeis).all }
It results in the following error:
NoMethodError: undefined method 'joins'