ActiveRecord: "Or" command? -
when writing activerecord queries, typically use regular sql syntax [field_a = 'b' or field_c = 'd'] when need use "or" in query. i'm wondering if there's way without resorting sql? have tried googling 'activerecord or' but, unsurprisingly, not joy.
any suggestions appreciated.
it's not possible (yet) using activerecord alone. parts of relation anded together, option use sql string part of .where()
otherwise can resort arel now: activerecord or query
Comments
Post a Comment