Skip to content

Instantly share code, notes, and snippets.

@drewkerrigan
Created November 21, 2012 01:28
Show Gist options
  • Save drewkerrigan/4122487 to your computer and use it in GitHub Desktop.
Save drewkerrigan/4122487 to your computer and use it in GitHub Desktop.
Developers Without Phone Snippet
no_email_count = 0
puts "email,full_name"
Developer.bucket.get_index('$bucket', '_').each do |devid|
u = Developer.find(devid).identity
if !u.mobile_number
puts u.email + "," + u.full_name
no_email_count+=1
end
end
total = Developer.count
puts "Total Developers: " + total.to_s
puts "Total Without Email: " + no_email_count.to_s
puts "Percentage: " + ((no_email_count.to_f / total.to_f) * 100.0).to_s + "%"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment