Could scope this as a sql query rather than instantiating a bunch of Ruby objects - doesn't seem like you would have a ton of records returning from this query, so you can probably get away with it as is.