title: activerecord nested conditions
body: <p>this is a follow up to a previous question i asked.  i am having trouble getting a query to work that has a variety of conditions for nested models.</p>
  
  <pre><code>user has_one avatar
  user has_one profile
  avatar belongs_to user
  profile belongs_to user
  </code></pre>
  
  <p>and i am actually able to get this to work...</p>
  
  <pre><code>Avatar.find(:all, :include =&gt; {:user =&gt; :profile}, :conditions =&gt; {:users =&gt; {:profiles =&gt; {:description =&gt; 'foo'}}})
  </code></pre>
  
  <p>however i want it to return an avatar if the profile.description is NOT NULL.</p>
  
  <pre><code>Avatar.find(:all, :include =&gt; {:user =&gt; :profile}, :conditions =&gt; {:users =&gt; {:profiles =&gt; "profiles.description IS NOT NULL"}})
  </code></pre>
  
  <p>so when i change the query to follow the SQL syntax rather than the railsesque syntax, i get an error "No such column user.profiles"</p>
  
  <p>it doesnt seem to matter what statement i use for "profiles.description IS NOT NULL", the error is the same.  it must be something else with that structure.</p>