Skip to content

Commit

Permalink
add rake task to scrub unsubscribe token of already deactivated users
Browse files Browse the repository at this point in the history
  • Loading branch information
yuenmichelle1 committed May 15, 2024
1 parent 9d56956 commit 30aaafa
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lib/tasks/user.rake
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,14 @@ namespace :user do
end
end

desc 'Scrub unsubscribe_token of deactivated users'
task scrub_inactive_user_unsubscribe_token: :environment do
User.where(activated_state: 'inactive').select(:id).find_in_batches do |users|
ids = users.map(&:id)
User.where(id: ids).update_all(unsubscribe_token: nil)
end
end

desc 'Backfill UX testing emails comms field in batches'
task backfill_ux_testing_email_field: :environment do
User.select(:id).find_in_batches do |users|
Expand Down

0 comments on commit 30aaafa

Please sign in to comment.