title: CakePHP select many to many (HABTM) records
body: <p>after create a many to many (HABTM) relationship between 2 classes (as code bellow) I was expecting to see results including the related records but for some reason this is not happening.</p>
  
  <p><strong>Models</strong></p>
  
  <pre><code>App::uses('AppModel', 'Model');
  class NewsCategory extends AppModel{
    public $hasAndBelongsToMany = array('News');
  }
  
  App::uses('AppModel', 'Model');
  class News extends AppModel{
    public $hasAndBelongsToMany = array('NewsCategory');
  }
  </code></pre>
  
  <p>I created a table called "news_news_categories" with both tables id.</p>
  
  <p><strong>Controller</strong></p>
  
  <pre><code>this-&gt;data = $this-&gt;News-&gt;find('first', array('conditions' =&gt; array('News.id' =&gt; $id)));
  </code></pre>
  
  <p>The result from code above doesn't include the related NewsCategory records.</p>
  
  <p>After spend hours trying to make this happen, I couldn't get this done.</p>
  
  <p>What I'm missing here?</p>
  
  <p>Thank you all in advance!</p>
  
  <hr>
  
  <p><strong>Update</strong></p>
  
  <p>When I dump the SQL code used by CakePHP using</p>
  
  <pre><code>echo $this-&gt;element('sql_dump');
  </code></pre>
  
  <p>the results didn't show any query (or joining) for this relationship. CakePHP is simply ignoring the $hasAndBelongsToMany config. </p>