title: Complex find conditions includes ''include"
body: <p>I'm developeing with Rails 2.3.8 Ruby 1.8.7 and PostgreSQL.
  I want to search records by relation.</p>
  
  <p><strong>UserGuildMaster</strong></p>
  
  <pre><code>class UserGuildMaster &lt; ActiveRecord::Base
      has_one :leader, :foreign_key =&gt; 'guild_id', :class_name =&gt; 'UserGuildLog', :conditions =&gt; {:leader_flag =&gt; 1, :status =&gt; 1}
      has_many :user_guild_logs, :foreign_key =&gt; 'guild_id', :class_name =&gt; 'UserGuildLog'
  end
  </code></pre>
  
  <p><strong>UserGuildLog</strong></p>
  
  <pre><code>class UserGuildLog &lt; ActiveRecord::Base
      belongs_to :guild, :class_name =&gt; "UserGuildMaster"
      belongs_to :user_master
      belongs_to :user_character, :class_name =&gt; "UserCharacter"
  end
  </code></pre>
  
  <p><strong>UserCharacter</strong></p>
  
  <pre><code>class UserCharacter &lt; ActiveRecord::Base
  end
  </code></pre>
  
  <p>I want to search <strong>UserGuildMaster</strong> which <strong>leader.user_character.logined_at is before 5days</strong> and which <strong>has less than 10 user_guild_logs</strong>.</p>
  
  <p>My find conditions is below, but it raise error <strong>'PGError: ERROR:  schema "leader"'does not exist.</strong></p>
  
  <pre><code>  @user_guild_masters = UserGuildMaster.find(:all, :include =&gt; [{:leader =&gt; :user_character}, :user_guild_logs], 
      :conditions =&gt; ['leader.user_character.logined_at &lt; ? AND user_guild_logs.size &lt; ?', 5.days.ago, 10]
    )
  </code></pre>
  
  <p>This Rails project is now on service and can't add or change column.
  I have no idea to finde these related records. Any ideas?</p>