title: NoMethodError: undefined method and for #ActiveRecord::Relation []
body: <p>I'm using Rails 5.  I want to write a where clause with an AND to only return results subject to two conditions.  I tried this</p>
  
  <pre><code>  new_orders = Order
      .joins(:line_items =&gt; { :shipping =&gt; :vendor })
      .where.not(
        :vendors =&gt; { :id =&gt; vendor_ids }
      )
    ).and( 
      Order.joins(:line_items).where(:holding =&gt; nil)
    )
  </code></pre>
  
  <p>but am getting a <code>NoMethodError: undefined method and for #ActiveRecord::Relation [].  Did you mean?  any?" error.</code></p>