Batching in Ruby to Prevent N+1 Queries