forgeplus/db/migrate/20200210111308_update_tidin...

6 lines
265 B
Ruby
Raw Normal View History

2020-03-09 00:40:16 +08:00
class UpdateTidingsDeleteStatus < ActiveRecord::Migration[5.2]
def change
# Tiding.where.not(container_type: 'DeleteCourse').where(belong_container_type: "Course", belong_container_id: Course.where(is_delete: 1).pluck(:id)).update_all(is_delete: 1)
end
end