20111019163257_add_problem_comments_count.rb 214 Bytes Edit Raw Blame History 1 2 3 4 5 6 7 8 9 10 class AddProblemCommentsCount < Mongoid::Migration def self.up Problem.all.each do |problem| problem.update_attributes(:comments_count => problem.comments.count) end end def self.down end end