title: Cakephp, Retrieve Data for HABTM Models using find
body: <p>I am new to cakephp and I'm trying to accomplish something that should be relatively easy.
  I have 2 models projects &amp; categories bind by HABTM relationship.</p>
  
  <p>I am trying to perform the following query -> find all projects that belong to a category</p>
  
  <pre><code>$projects = $this-&gt;Project-&gt;find('all', array('conditions' =&gt; array('Category.slug' =&gt; $category)));
  </code></pre>
  
  <p>However when I'm doing so it generates an SQL error: </p>
  
  <pre><code>SQL Error: 1054: Unknown column 'Category.slug' in 'where clause' 
  </code></pre>
  
  <p>What am I doing wrong?</p>