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
384 B

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