title: Find by include nil object error in rails
body: <p>I've been trying hard to solve this problem but i really don't know what is happening. I have this small piece of code :</p>
  
  <pre><code>DiscoveredLocation.find_by_user_id(user.id, :include =&gt; [:boss_kills])
  </code></pre>
  
  <p>The models are :</p>
  
  <pre><code>DiscoveredLocation(id, user_id, boss_location_id)
  BossKill(user_id, monster_id)
  </code></pre>
  
  <p>and associations :</p>
  
  <pre><code>Monster belongs_to :boss_location
  Monster has_many :boss_kills
  
  BossKill belongs_to :user
  BossKill belongs_to :monster
  
  
  DiscoveredLocation belongs_to :user
  DiscoveredLocation  belongs_to :boss_location
  
  DiscoveredLocation  has_many :monsters, :through =&gt; :boss_location
  
  DiscoveredLocation  has_many :boss_kills, :through =&gt; :monsters
  </code></pre>
  
  <p>When i executed the find_by i get this error :</p>
  
  <pre><code>NoMethodError in BossesController#index
  
  You have a nil object when you didn't expect it!
  You might have expected an instance of Array.
  The error occurred while evaluating nil.each
  </code></pre>
  
  <p>If i change the include option to any other model, like :monster, it works great. I'm pretty much owned by this problem :P. Maybe somebody can help me ? :)</p>