AR insists on escaping user input when using the find() method, which is
commendable. But what if you need the equivalent of
SELECT * FROM user WHERE email LIKE ‘%#{params[:terms]}%’
??
putting
:conditions => [“email LIKE ‘%?%’”, params[:terms]]
will asplode for obvious reasons.
Also, what if I have an array coming from the form and what to put the
values into a IN() clause, i.e
…WHERE dept_id IN (1,2,3,4,5)
doing
:conditions => [“dept_id IN (?)”, params[:email].join(’,’)]
will not do anything useful.
So in short, I need access to the function that allows me to directly
escape user input myself. AWDWROR and G$$gle were no help finding it.
thanks
Sam