How to do AND or OR in WHERE ?

I would like to do
validate present(:payer_member_id), where: [attribute_does_not_equal(:state, :pencil) AND attribute_does_not_equal(:state, :draft_pencil)]
validate present(:payer_member_id), where: [attribute_does_not_equal(:state, :pencil) AND attribute_does_not_equal(:state, :draft_pencil)]
or
validate present(:payer_member_id), where: [attribute_does_not_equal(:state, :pencil) AND attribute_does_not_equal(:state, :draft_pencil)]
validate present(:payer_member_id), where: [attribute_does_not_equal(:state, :pencil) AND attribute_does_not_equal(:state, :draft_pencil)]
how to do the AND or the OR in the where ?
1 Reply
ZachDaniel
ZachDaniel3w ago
Where is automatically an and And there is an any validation
validate present(:payer_member_id), where: [foo(), any([bar(), baz()])]
validate present(:payer_member_id), where: [foo(), any([bar(), baz()])]

Did you find this page helpful?