I have following statement in controller: Sale.find(:all,:conditions => ["users.team_id IN (?)", Team.teams_ids(id)], :include => [:user], :group => "sales.stage_id") ... but when looking to log the ''group by'' is not generated in SQL ''select'' statement so no grouping occures in resultset. Are there any special conditions for using '':group'' in find statement? Thanks, David -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---
Mark Reginald James
2006-Sep-24 12:52 UTC
Re: Find statement and '':group => '' udage ....
David Marko wrote:> I have following statement in controller: > > Sale.find(:all,:conditions => ["users.team_id IN (?)", > Team.teams_ids(id)], :include => [:user], :group => "sales.stage_id") > > ... but when looking to log the ''group by'' is not generated in SQL > ''select'' statement so no grouping occures in resultset. Are there any > special conditions for using '':group'' in find statement?You can''t use :group if you also use :include. You can use :order, if that''s what you intended. -- We develop, watch us RoR, in numbers too big to ignore. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---