Skip to content

Instantly share code, notes, and snippets.

@jdubs
Created October 17, 2013 01:30
Show Gist options
  • Save jdubs/7017904 to your computer and use it in GitHub Desktop.
Save jdubs/7017904 to your computer and use it in GitHub Desktop.
broken rake file
namespace :website do
desc "Remove test users from intercom"
task :remove_test_users_from_intercom => :environment do
Intercom.app_id = ENV["INTERCOM_APP_ID"]
Intercom.api_key = ENV["INTERCOM_APP_KEY"]
test_email_accounts = ['sharklasers.com', 'blah.com']
puts "Starting Job"
# Account.all.each do |user|
Intercom::User.all.each do |user|
test_email_accounts.each do |test_addresses|
if user.email.include?(test_addresses)
puts user.email, user.id
# user = Intercom::User.delete(:email => user.email, :user_id => user.id)
break
end
end
end
puts "Finished running rake"
end
end
$ rake website:remove_test_users_from_intercom
rake aborted!
uninitialized constant Intercom
~/website/lib/tasks/delete-test-users-intercom.rake:7:in `block (2 levels) in <top (required)>'
Tasks: TOP => website:remove_test_users_from_intercom
(See full trace by running task with --trace)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment