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