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/20150906025009_forge_activi...

26 lines
615 B

class ForgeActivituesDate < ActiveRecord::Migration
def up
forge_count = ForgeActivity.all.count / 30 + 2
transaction do
for i in 1 ... forge_count do i
ForgeActivity.page(i).per(30).each do |activity|
unless activity.forge_act_type == "ProjectCreateInfo"
if activity.forge_act
unless activity.forge_act.project
# puts activity.id
activity.destroy
end
else
# puts activity.id.to_s + "----"
activity.destroy
end
end
end
end
end
end
def down
end
end