```ruby
namespace :offerings do
  
  desc "recalculate the 'offerings_count' field for runnable objects"
  task :set_counts => :environment  do
    %w(Investigation ResourcePage Page Portal::Teacher).each do |c|    
      c.classify.constantize.all(:include => :offerings).each do |rec|
        rec.update_attribute(:offerings_count, rec.offerings.size)
      end
    end
  end
  
end```

Add friendly output to the offerings rake task
user
```ruby
namespace :offerings do
  
  desc "recalculate the 'offerings_count' field for runnable objects"
  task :set_counts => :environment  do
    updating_models = %w(Investigation ResourcePage Page Portal::Teacher)
    
    updating_models.each_with_index do |c, i|    
      puts "Updating #{c.pluralize} (step #{i+1} of #{updating_models.size}) ..."
      c.classify.constantize.all.each do |rec|
        rec.update_attribute(:offerings_count, rec.offerings.count)
      end
    end
  end
  
end```
assistant