Last active
September 12, 2022 18:00
-
-
Save cesartalves/d63ede9b3c4e08f603bec31d545dc23f to your computer and use it in GitHub Desktop.
Delete Users
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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