parent
462e5ab589
commit
2a9d6eb012
@ -0,0 +1,12 @@
|
||||
class MigrateCourseFileType < ActiveRecord::Migration
|
||||
def change
|
||||
# 迁移原课程资源文件类型
|
||||
Attachment.all.each do |attach|
|
||||
if attach.container_type == "Course" && attach.attachtype == 1
|
||||
attach.attachtype = 4
|
||||
attach.save
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
end
|
Loading…
Reference in new issue