The :select => :id means that the SQL is select id from projects, rather than select * ( everything ) from projects when you only need the ID.
Also, if you’re feeling fancy you can change
.collect {|p| p.id}
to
.map(&:id)
which does the same thing. The &:id results in a call to Symbol#to_proc. :id is the symbol, and the to_proc results in {|p| p.id} - it’s just some syntax sugar.