I am unable to do a simple condition for my paginator. I have a Survey and Campaign models. Campaigns hasMany Surveys setup in the Campaign model.
I want to select a survey and the paginator should display the campaign is linked to, but I keep getting a Unknown column Survey.id – On inspection I see that Survey is not joined to the Campaign model, only in the WHERE clause. I also found out that hasMany does not join the tables to the query.
How else can I go about doing the above?
I could not find an answer to this. It appears that hasMany does not automatically get added to a query. I have had recommendations that using the containable feature in cake may help.