Merge branch 'szzh' of http://repository.trustie.net/xianbo/trustie2 into szzh
commit
c4907531dc
@ -0,0 +1,23 @@
|
|||||||
|
class UpdateCourseActivity < ActiveRecord::Migration
|
||||||
|
def up
|
||||||
|
count = CourseActivity.all.count / 30 + 2
|
||||||
|
transaction do
|
||||||
|
for i in 1 ... count do i
|
||||||
|
CourseActivity.page(i).per(30).each do |activity|
|
||||||
|
if activity.course_act
|
||||||
|
if activity.course_act_type == 'Poll'
|
||||||
|
if activity.course_act.polls_status == 1
|
||||||
|
activity.destroy
|
||||||
|
end
|
||||||
|
end
|
||||||
|
else
|
||||||
|
activity.destroy
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def down
|
||||||
|
end
|
||||||
|
end
|
Loading…
Reference in new issue