15 lines
321 B
Ruby
15 lines
321 B
Ruby
|
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
|