Skip to content

Instantly share code, notes, and snippets.

@sprite2005
Created May 3, 2009 20:34
Show Gist options
  • Save sprite2005/106155 to your computer and use it in GitHub Desktop.
Save sprite2005/106155 to your computer and use it in GitHub Desktop.
@placed_calls = current_user.call_logs.find(:all, :conditions => ['client_id = ?', current_user.id])
@placed_calls_count = Hash.new(0)
@placed_calls.collect { |e| e.vendor }.flatten
@placed_calls.each { |e| @placed_calls_count[e.vendor] += 1}
@placed_calls_count.sort {|a, b| a <=> b}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment