i have budgets table with emptype_id and calendar_id actual_head, estimated_head
when i do Budgets.sum(:actual_head ,:group=>\"emptype_id,calendar_id\")
I'm not sure of this, buy try :group => [:emptype_id, :calendar_id]
I cheat. Do :group => ["emptype_id,calendar_id"].
Not want you nor I want, but this works at least.
Grouping with multiple columns cannot be supported by rails. You have to use a regular find all:
budgets = Budgets.find(:all,
:select => "emptype_id, calendar_id, sum(budgets.actual_head) AS sum_actual_head",
:group => "emptype_id, calendar_id")
budgets.each { |budget| puts budget.sum_actual_head }