Set all current users to confirmed

This commit is contained in:
Matt-Yorkley
2017-08-23 14:35:56 +01:00
committed by Rob Harrington
parent 97f5022bdd
commit aead867ea0

View File

@@ -6,8 +6,8 @@ class AddConfirmableToUser < ActiveRecord::Migration
add_column :spree_users, :unconfirmed_email, :string
add_index :spree_users, :confirmation_token, :unique => true
# Set users to confirmed if they previously confirmed their email for an enterprise
execute "UPDATE spree_users SET confirmed_at = enterprises.confirmed_at FROM enterprises WHERE spree_users.email = enterprises.email AND enterprises.confirmed_at IS NOT NULL"
# Set all current users to confirmed
Spree::User.update_all(confirmed_at: Time.zone.now)
end
def down