title: CakePHP Fatal Error Call to a member function schema() on a non-object
body: <p>I have some trouble finding a solution for this..</p>
  
  <pre><code>Error: Call to a member function schema() on a non-object
  File: /Cake/Model/Model.php
  Line: 3627
  </code></pre>
  
  <p>In my Database there are the tables <strong>articles</strong>,<strong>hashtags</strong> and the association <strong>articles_hashtags</strong> with the foreignkeys article_id and hashtag_id .. So i am trying to get the information what hashtags each article has.. </p>
  
  <p><strong>My Article Model</strong></p>
  
  <pre><code>class Article extends AppModel {
   public $hasAndBelongsToMany = array(
      'Hashtag' =&gt;
          array(
              'className' =&gt; 'Hashtag',
              'joinTable' =&gt; 'articles_hashtags',
              'foreignKey' =&gt; 'article_id',
              'associationForeignKey' =&gt; 'hashtag_id',
              'unique' =&gt; true,
              'conditions' =&gt; '',
              'fields' =&gt; '',
              'order' =&gt; '',
              'limit' =&gt; '',
              'offset' =&gt; '',
              'finderQuery' =&gt; '',
              'with' =&gt; ''
                 )  
              ); 
            }
  </code></pre>
  
  <p><strong>Article Controller</strong></p>
  
  <pre><code>class ArticleController extends AppController {
  var $name = 'Article';
   public $helpers = array("Html", "Form");
      public function index() 
      {
      $this-&gt;set("posts", $this-&gt;Article-&gt;find("all"));
  
      } 
  }
  </code></pre>
  
  <p>Thanks for your help!!</p>
  
  <p>Additionally: 
  If i put the generated sql select query from the debugger sql log into my sql database i get the right results .. so i guess theres something wrong with the controller?! </p>