title: RoR has_and_belongs_to_many
body: <p>I have two database tables being domains and categories.</p>
  
  <p>Domains can have many categories and categories can have many domains.</p>
  
  <p>Both models are setup using has_and_belongs_to_many.</p>
  
  <p>Logically when a category is associated with a domain conversely a domain is associated with a category. However...</p>
  
  <pre><code>irb(main):062:0&gt; domain.categories.any?
  =&gt; false
  irb(main):063:0&gt; category.domains.any?
  =&gt; true
  </code></pre>
  
  <p>What am I missing? </p>