Created
July 19, 2015 13:25
-
-
Save edipofederle/600354528f01e01ce9e4 to your computer and use it in GitHub Desktop.
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
Configuration.all.each do |configuration| | |
begin | |
User.find(configuration.user_id) | |
rescue | |
user_id = configuration.user_id | |
Configuration.where(user_id: user_id).delete_all | |
Client.where(user_id: user_id).delete_all | |
Order.where(user_id: user_id).delete_all | |
Product.where(user_id: user_id).delete_all | |
Topmail.where(user_id: user_id).delete_all | |
Label.where(user_id: user_id).delete_all | |
end | |
end | |
ids = [] | |
Client.all.each do |c| | |
begin | |
User.find(c.user_id) | |
rescue | |
ids << c.id | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment