You can just do `:id => ids` here for the condition, and rails will construct an SQL IN for you.