Update migration to set terms_of_service_accepted_at to time of deployment

This commit is contained in:
Gaetan Craig-Riou
2023-11-17 14:16:33 +11:00
committed by Konrad
parent 8371eada23
commit d2b210c818

View File

@@ -1,5 +1,13 @@
class AddTermsOfServiceAcceptedAtToSpreeUsers < ActiveRecord::Migration[7.0]
def change
def up
add_column :spree_users, :terms_of_service_accepted_at, :datetime
if Spree::Config.enterprises_require_tos == true
Spree::User.update_all(terms_of_service_accepted_at: Time.zone.now)
end
end
def down
remove_column :spree_users, :terms_of_service_accepted_at
end
end