socialforge/db/migrate/20160111071348_static_proje...

15 lines
321 B
Ruby
Raw Normal View History

2016-01-12 10:38:50 +08:00
class StaticProjectBoards < ActiveRecord::Migration
def up
Project.all.each do |project|
puts project.id
unless project.boards.first.nil?
boards_count = project.boards.first.topics.count
project.update_attribute(:boards_count, boards_count)
end
end
end
def down
end
end