Accessing 3rd association

Entisseme

New Member
I have following models:- Agenda (id, user_id, event_id) -> belongsto Event, User- Event (id, etc) -> hasmany Agenda- User (id, city_id, etc) -> hasmany Agenda, belongsto City- City (id, name) -> hasmany UserWhile in the Agendas controller, I want to display the City.name of an user that has a certain event_id in his Agendas. How can I add City data to the User array of the Agendas array?N.B. I don't want to use recursive 2 because that loads way to much data into the array.
 
Back
Top