数据迁移
This commit is contained in:
parent
c25b63a254
commit
baaff3f988
|
@ -4,8 +4,8 @@ class DeleteEmptyApplyHomework < ActiveRecord::Migration
|
||||||
transaction do
|
transaction do
|
||||||
for i in 1 ... count do i
|
for i in 1 ... count do i
|
||||||
ApplyHomework.page(i).per(30).each do |ah|
|
ApplyHomework.page(i).per(30).each do |ah|
|
||||||
homework = HomeworkCommon.find ah.homework_common_id
|
homework = HomeworkCommon.where("id = ?",ah.homework_common_id)
|
||||||
if homework.nil?
|
if homework.empty?
|
||||||
ah.destroy
|
ah.destroy
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue