class RecalculateMutedAssignments < ActiveRecord::Migration
def self.up
course_ids = Assignment.where(:muted => true, :context_type => 'Course').select(:context_id).uniq.map(&:context_id)
course_ids.each do |id|
c = Course.find id
c.recompute_student_scores
end
def self.down
raise ActiveRecord::IrreversibleMigration