Skip to content

Instantly share code, notes, and snippets.

@rodrei
Created November 8, 2012 20:34
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 rodrei/4041407 to your computer and use it in GitHub Desktop.
Save rodrei/4041407 to your computer and use it in GitHub Desktop.
Subscriptions auditory
begin
free = []
non_free = []
subs_nil = []
User.all.each do |u|
if u.subscription.nil?
subs_nil << u
elsif u.subscription.plan.name == "free"
free << u
else
non_free << u
end
end
puts "FREE #{free.size}"
puts "NON FREE #{non_free.size}"
puts "SUBSCRIPTION NIL #{subs_nil.size}"
subs_nil.sort! {|a,b| a.created_at <=> b.created_at }
puts subs_nil.first.created_at
puts subs_nil.last.created_at
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment