Hi, Model.count works. however, Model.average Model.minimum Model.maximum Model.calculate gives undefined method `...'' is this due to an old rails version? (I would give it here but ''rails --version'' gives "rails: version unknown") Thanks! -- 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?hl=en -~----------~----~----~----~------~----~------~--~---
On 2/3/07, Alon Goldshuv <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> > Hi, > > Model.count > > works. > > however, > > Model.average > Model.minimum > Model.maximum > Model.calculate > > gives undefined method `...'' > > is this due to an old rails version? (I would give it here but ''rails > --version'' gives "rails: version unknown") > > Thanks!Possibly. According to active record''s CHANGELOG, they''ve been in rails since 1.14.0: ---- *1.14.0* (March 27th, 2006) ... * Added calculations: Base.count, Base.average, Base.sum, Base.minimum, Base.maxmium, and the generic Base.calculate. All can be used with :group and :having. Calculations and statitics need no longer require custom SQL. #3958 [Rick Olson]. ---- If you installed it via gems, you can get versions of things from the gem command: gem list -l | grep ^activerecord I''ve never seen "version unknown", and grepping the sources of the versions I have doesn''t reveal this string. --~--~---------~--~----~------------~-------~--~----~ 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?hl=en -~----------~----~----~----~------~----~------~--~---
Thanks George. I get "activerecord (1.11.1)" so I guess my version is not up to date enough to be able to use these commands. I''ll update it to a later version, wanted to do so anyway... doing ''gem list'' (thanks didn''t know about that) i see that i have rails 0.13.1... -- 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?hl=en -~----------~----~----~----~------~----~------~--~---