Skip to content

Instantly share code, notes, and snippets.

@jottr

jottr/console.md Secret

Last active March 25, 2016 14:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jottr/0dae2e7f5220a59f3187 to your computer and use it in GitHub Desktop.
Save jottr/0dae2e7f5220a59f3187 to your computer and use it in GitHub Desktop.
$ table = CSV.table('recipients.csv')
$ table.count #=> 26504
$ found.count #=> 3

After running quick.rb I get table.count #=> 0
What am I overlooking?

require 'csv'
recipient = CSV.read('short.csv', headers: true)
found = User.where(email: recipient['email']).each{ |u| puts u.email }
table = CSV.table('recipients.csv')
table.delete_if do |t|
found.each do |f|
f.email == t[:email]
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment