Skip to content

Instantly share code, notes, and snippets.

@adamgamble
Created December 2, 2010 17:34
Show Gist options
  • Select an option

  • Save adamgamble/725718 to your computer and use it in GitHub Desktop.

Select an option

Save adamgamble/725718 to your computer and use it in GitHub Desktop.
@agents = @bucket.find(:all, :joins => {:store => [:agent]}, :select => "agents.name as agent_name, COUNT(card_creation_transactions.id) as card_creation_transaction_count, card_creation_transactions.store_id, card_id", :group => "agents.name", :order => "agents.name")
@agents.map! {|cct| {"agent_name" => cct.attributes["agent_name"], "card_creation_transaction_count" => cct.attributes["card_creation_transaction_count"]}}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment