Skip to content

Instantly share code, notes, and snippets.

@cesartalves
Last active September 12, 2022 18:00
Show Gist options
  • Save cesartalves/d63ede9b3c4e08f603bec31d545dc23f to your computer and use it in GitHub Desktop.
Save cesartalves/d63ede9b3c4e08f603bec31d545dc23f to your computer and use it in GitHub Desktop.
Delete Users
# GET file from Importer url on dashboard
url = ''
file_data = Net::HTTP.get URI(url)
csv = CSV.parse(
file_data,
headers: true,
encoding: 'UTF-8',
header_converters: ->(h) { h.strip }
)
csv.each do |col|
Spree::User.where(email: col['Email']).first&.destroy
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment