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
new_orders = Order
.joins(:line_items => { :shipping => :vendor })
.where.not(
:vendors => { :id => vendor_ids }
)
).and(
Order.joins(:line_items).where(:holding => nil)
)
but am getting a NoMethodError: undefined method and for #ActiveRecord::Relation []. Did you mean? any?" error.