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

Popular posts from this blog

400 Bad Request on Apache/PHP AddHandler wrapper -

Add email recipient to all new Trac tickets -

php - Change action and image src url's with jQuery -