0

How do I use the AggregateResult I receive from a query using the databasedotcom gem?

quer = "SELECT SUM(MRR__c) FROM Account WHERE Type = 'Customer' AND Go_Live_Date__c > 2012-01-01 GROUP BY Producer__c"
ff = client.query quer
[#<SalesforceCont::AggregateResult:0x00000102e707b8 @Id=nil>, #   
<SalesforceCont::AggregateResult:0x00000102e70380 @Id=nil>, #
<SalesforceCont::AggregateResult:0x00000102e6ff48 @Id=nil>, #
<SalesforceCont::AggregateResult:0x00000102e6fb10 @Id=nil>] 

I can not figure out how to use them. The in the documentation mentioned "get" or anything similar does not exist.

Bill the Lizard
  • 398,270
  • 210
  • 566
  • 880
mmlac
  • 1,091
  • 1
  • 9
  • 24
  • Also when I use the examples from Salesforce I only get those @Id=nil objects. http://www.salesforce.com/us/developer/docs/api/Content/sforce_api_calls_query_aggregateresult.htm – mmlac Feb 24 '12 at 23:16
  • Could you enable debugging in the client, then send the output from when you call client.query? –  Feb 25 '12 at 09:32

1 Answers1

2

The databasedotcom gem does not currently support AggregateResult. However, I encountered this same issue a while ago and made a quick-and-dirty fix that lets it return AggregateResults properly. It is available here: https://github.com/JackSullivan/databasedotcom

John Sullivan
  • 1,301
  • 1
  • 10
  • 20