I have two models, Zones and Regions. I cannot figure out why Cake's find will not allow me to specify fields from the related tables.
These conditions, only requesting fields from the first table work fine.
$conditions = array('fields' => array('Zone.id','Zone.title','Zone.color'));
These conditions cause problems because... reasons?
$conditions = array('fields' =>
array('Zone.id','Zone.title','Zone.color','Region.id','Region.title'));
Basic query, this is how I'm using the conditions.
$result = $this->Zone->find('all',$conditions);
The SQL Cake is generating:
SELECT "Zone"."id" AS "Zone__id", "Zone"."title" AS "Zone__title", "Zone"."color"
AS "Zone__color", "Region"."id" AS "Region__id", "Region"."title" AS "Region__title"
FROM "public"."zones" AS "Zone" WHERE 1 = 1
Why is Cake assuming that the Region.fields are part of the Zones model? Why isn't this working as expected?