I try to find all users except users with an id that is a member of an array exclude_ids
Here is what I have:
User.where("id != ?", exclude_ids)
This only works when exclude_ids has only 1 element. If it has more than one item, I get
this error:
ActiveRecord::StatementInvalid: SQLite3::SQLException: near ",": syntax error: SELECT "users".* FROM "users" WHERE (id != 1,2)
I would appreciate any help.
James source
share