Eu tenho esse relacionamento
.
Como eu faço para consultar no activerecordActiveRecord
para retornar os dados de WorksWorks
, WorkZeiWorkZei
e Wi_schools.Wi_schools
?
Eu tentei assim: r = Responsible.find(1)
students = r.students
r = Responsible.find(1)
students = r.students
students.each {|s| s.school.joins(:works,:work_zeis).all }
students.each {|s| s.school.joins(:works,Resulta no seguinte erro:work_zeis).all }
NoMethodError: undefined method `joins'
NoMethodError: undefined method `joins'