The raw query I’m trying to get plugged in here is:
SELECT * FROM x WHERE CONCAT(y, ' ', x) LIKE '%value%';
I’ve checked through the AR docs and can’t find anything that would allow me to do this. I’m not very familiar with how exactly it’s constructing these queries, and was hoping someone could point me in the right direction. Thanks a bunch.
If you want to use the AR class you need to pass FALSE as third parameter to avoid the query being escaped automatically. You are now left to escaping the argument by yourself:
Refer to point 4) in the Active Record session of the manual. Quoting:
An easier way, imho, whould be to run a “regular” query and take advantage of binding: