You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
trustieforge/db/migrate/20160111071348_static_proje...

15 lines
321 B

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