Is is possible in Rails > 3.2 to add conditions to the join statement generated by the includes
method?
Let\'s say I have two models, Person and Note. E
For people interested, I tried this where a record attribute was false
Lead.includes(:contacts).where("contacts.primary" => false).first
and this doesn't work. Somehow for booleans only true
works, so I turned it around to include where.not
Lead.includes(:contacts).where.not("contacts.primary" => true).first
This works perfectly