diff --git a/db/migrate/20120822195841_set_first_notice_at_on_problems.rb b/db/migrate/20120822195841_set_first_notice_at_on_problems.rb new file mode 100644 index 0000000..a81bbec --- /dev/null +++ b/db/migrate/20120822195841_set_first_notice_at_on_problems.rb @@ -0,0 +1,10 @@ +class SetFirstNoticeAtOnProblems < Mongoid::Migration + def self.up + Problem.all.each do |problem| + problem.update_attribute :first_notice_at, problem.notices.order_by([:created_at, :asc]).first.try(:created_at) + end + end + + def self.down + end +end \ No newline at end of file -- libgit2 0.21.2