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/20160111080914_static_proje...

17 lines
369 B

class StaticProjectActs < ActiveRecord::Migration
def up
Project.all.each do |project|
acts = ForgeActivity.where("project_id = ?", project.id)
unless acts.blank?
count = acts.count
puts project.id
puts "acts_count is #{count}"
project.update_attribute(:acts_count, count)
end
end
end
def down
end
end