title: Filtering Containable Model Results
body: <p>I am trying with the following line of code to filter all the Posts that have certain (irrelevant) conditions, by the tag "who"</p>
  
  <p>$com= $this->Post->find('all', array('conditions' => $conditions, 'contain' => 'Tag.tag="who"'));</p>
  
  <p>However, instead of the results being only the posts with the tags, I get every single post with empty tag arrays for the ones that don't have the tag "who".</p>
  
  <p>I know my question has come up before, but the solutions posted have not worked with my code.
  I have tried adapting the code here to my own:
  <a href="http://web-development-blog.co.uk/2010/09/14/cakephp-habtm-find-with-conditions-and-containable-behavior/" rel="nofollow">http://web-development-blog.co.uk/2010/09/14/cakephp-habtm-find-with-conditions-and-containable-behavior/</a>, but I get an SQL error stating "Tag.post_id" not found in on clause.</p>
  
  <p>Please help.</p>
  
  <p>Error message when trying to implement code from selected link:</p>
  
  <pre><code>SELECT `Post`.`id`, `Post`.`title`, `Post`.`body`, `Post`.`created`,       `Post`.`modified`, `Tag`.`id`, `Tag`.`tag`, `Tag`.`created`, `Tag`.`modified` FROM `posts` AS `Post` LEFT JOIN `tags` AS `Tag` ON (`Tag`.`post_id` = `Post`.`id`) WHERE `Tag`.`tag` = 'who'    1054: Unknown column 'Tag.post_id' in 'on clause'            
  </code></pre>
  
  <p>Which is caused by using this:</p>
  
  <pre><code>$this-&gt;Post-&gt;bindModel(array('hasOne' =&gt; array('Tag')));
  $this-&gt;Post-&gt;contain(array(
    'Tag'
  ));
  $com=$this-&gt;Post-&gt;find('all', array(
    'conditions'=&gt;array('Tag.tag'=&gt;'who') 
  )); 
  </code></pre>