I want to add a where clause for my 2nd level association in cakephp. In my understanding this should work but it gives me an error
Error: [PDOException] SQLSTATE[42S22]: Column not found: 1054 Unknown column 'User.email_address' in 'where clause'.
$options = array(
'contain' => array(
'People',
'People' => array('User')
),
'conditions'=> array(
'User.email_address' => 'sample@mail.com'
),
'recursive' =>1,
);
$query = $this->Organization->find('all', $options);