Reset stuck exports

This commit is contained in:
Benjamin Neff 2017-08-14 00:33:09 +02:00
parent 172f80bcae
commit 1db6381308
No known key found for this signature in database
GPG key ID: 971464C3F1A90194

View file

@ -0,0 +1,12 @@
class ResetExportStates < ActiveRecord::Migration[5.1]
class User < ApplicationRecord
end
def up
# rubocop:disable Rails/SkipsModelValidations
User.where(exporting: true).update_all(exporting: false, export: nil, exported_at: nil)
User.where(exporting_photos: true)
.update_all(exporting_photos: false, exported_photos_file: nil, exported_photos_at: nil)
# rubocop:enable Rails/SkipsModelValidations
end
end