Divide contents of one hash with contents of another in Rails

You can use ActiveRecord::Calculations#average like this:

daily_average = monthly_subscriptions_new.group_by_day(:created_at)
                                         .average(:total_spend)