Cleaned up deprecated values

There was a warning flagging for ':all' being deprecated in rails 3.2
@bessey.

So I cleaned up the code and slightly sped up the query.