socialforge/db/migrate/20160111080914_static_proje...

17 lines
369 B
Ruby

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