Running a simple statement on my User model but keep on getting errors about the operator not matching any of the given arguments. I've never run into anything like this before and don't know how to handle it. I understand I have to perhaps add type casts, but in my POSTGRES database the column keywords is of type array.
@users = User.where("keywords ILIKE ?", "%#{params[:keywords]}%")
How do you handle this?
Exact error message:
ActionView::Template::Error (PG::SyntaxError: ERROR: syntax error at or near "ANY"
LINE 1: SELECT "users".* FROM "users" WHERE (ANY(keywords) LIKE '%an...
^
: SELECT "users".* FROM "users" WHERE (ANY(keywords) LIKE '%angularjs%')):
Thanks!