mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-28 01:53:25 +00:00
Set all current users to confirmed
This commit is contained in:
committed by
Rob Harrington
parent
97f5022bdd
commit
aead867ea0
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user