title: Rails Query transformation for Rails 4.2.0
body: <p>I'm upgrading from Rails 3.2.12 to 4.2.0</p>
  
  <p>Most things are working now, but one query is a problem. Don't know how to transform it for 4.2.0</p>
  
  <pre><code>user_lesson = self.user_lessons.find :first,
                :include =&gt; [:lesson],
                :conditions =&gt; ["worked = ? AND passed = ?", true, false],
                :order =&gt; "lessons.sort"
  </code></pre>
  
  <p>I have a second one with problems</p>
  
  <pre><code>memberships = Membership.find :all,
       :include =&gt; [:course],
       :conditions =&gt; ["next_mindmail &lt; ? AND course_objects.active = ?", DateTime.now.utc, true]
  </code></pre>
  
  <p>I tried this: </p>
  
  <pre><code>memberships = Membership.joins(:course).where("next_mindmail &lt; ? AND active = ?", DateTime.now.utc, true).all
  </code></pre>
  
  <p>But it seems not to be the same...</p>