class MigrateCourseFileType < ActiveRecord::Migration
  def change
    # 迁移原课程资源文件类型
    Attachment.all.each do |attach|
      if attach.container_type == "Course" && attach.attachtype == 1
        attach.attachtype = 4
        attach.save(:validate => false)
      end
    end
  end

end
