2016-01-12 10:38:50 +08:00
|
|
|
class StaticProjectIssues < ActiveRecord::Migration
|
|
|
|
def up
|
|
|
|
Project.all.each do |project|
|
2016-01-13 12:53:09 +08:00
|
|
|
unless project.issues.nil?
|
|
|
|
issues_count = project.issues.count
|
|
|
|
project.update_attribute(:issues_count, issues_count)
|
|
|
|
end
|
2016-01-12 10:38:50 +08:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
def down
|
|
|
|
end
|
|
|
|
end
|