I've had a similar question a long time ago and created this gem https://github.com/codesnik/calculate-all/
with it you can do
Model.group(:status).calculate_all(:max_id, :min_id)
It is just a convenient wrapper around pluck, though.