I've been trying to make the following query works, but I couldn't:
SELECT "users".* FROM "users" WHERE (users.roles LIKE "%sales%")
SELECT "users".* FROM "users" WHERE (users.roles LIKE '%sales%')
ERROR: operator does not exist: character varying ~~ unknown LINE
1: select users.id from users where users.roles LIKE '%sales%'...
SELECT "users".* FROM "users" WHERE 'sales' = ANY(users.roles)
Having said that, it's worth noting:
Tip: Arrays are not sets; searching for specific array elements can be a sign of database misdesign. Consider using a separate table with a row for each item that would be an array element. This will be easier to search, and is likely to scale better for a large number of elements.