socialforge/db/migrate/20151217051447_delete_valid...

16 lines
280 B
Ruby
Raw Normal View History

class DeleteValidProject < ActiveRecord::Migration
def up
projects = Project.where("project_type =?", 1)
begin
projects.each do |p|
p.delete
end
rescue => e
logger.error "Delete project failed ====>#{e}"
end
end
def down
end
end