cast type in search (function lower text does not exist error)
Created by: jalberto
Current search try to use lower() function in PG, thsi funciton only accepts an string since PG 8.4, so it will be a good idea to add coercion to the query to avoid problems with nil columns.
rewrite the quey to:
"lower(text(#{quote_attr(attr)})) LIKE ?"
is enough