matt@polycot.com
2007-May-09 17:13 UTC
AR association count deprecation missing from deprecation page
Right now if you have: class User < ActiveRecord::Base has_many :purchases end ...and call: user.purchases_count You''ll get a deprecation warning which points you to http://www.rubyonrails.org/deprecation. I know to use user.purchases.count instead and why, but it would be good to amend the page for other folks who end up there. Maybe something like: *association*_count use model.association.count instead Best, -Matt --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---
Michael Koziarski
2007-May-12 01:47 UTC
Re: AR association count deprecation missing from deprecation page
Man that page is ugly :) I''ve added an entry for the case you found. However I think it might be an idea to start up a wiki page with some more useful information. All the best... On 5/10/07, matt@polycot.com <matt@polycot.com> wrote:> > Right now if you have: > > class User < ActiveRecord::Base > has_many :purchases > end > > ...and call: > > user.purchases_count > > You''ll get a deprecation warning which points you to > http://www.rubyonrails.org/deprecation. I know to use > user.purchases.count instead and why, but it would be good to amend > the page for other folks who end up there. > > Maybe something like: > > *association*_count > use model.association.count instead > > Best, > > -Matt > > > > >-- Cheers Koz --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---
matt@polycot.com
2007-May-14 23:27 UTC
Re: AR association count deprecation missing from deprecation page
Thanks! If/when it does point to a wiki page I''d certainly be happy to extend/improve explanations as I run into them. -Matt On May 11, 8:47 pm, "Michael Koziarski" <mich...@koziarski.com> wrote:> Man that page is ugly :) > > I''ve added an entry for the case you found. However I think it might > be an idea to start up a wiki page with some more useful information. > > All the best... > > On 5/10/07, m...@polycot.com <m...@polycot.com> wrote: > > > > > > > Right now if you have: > > > class User < ActiveRecord::Base > > has_many :purchases > > end > > > ...and call: > > > user.purchases_count > > > You''ll get a deprecation warning which points you to > >http://www.rubyonrails.org/deprecation. I know to use > > user.purchases.count instead and why, but it would be good to amend > > the page for other folks who end up there. > > > Maybe something like: > > > *association*_count > > use model.association.count instead > > > Best, > > > -Matt > > -- > Cheers > > Koz--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---