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

asp.net - repeatedly call AddImageUrl(url) to assemble pdf document -

java - Android recognize cell phone with keyboard or not? -

iphone - How would you achieve a LED Scrolling effect? -