I''ve already filed a bug: http://dev.rubyonrails.org/ticket/10804 I''m still not sure if i''m missing something. When I update a child by setting the association method to nil, the counter of the parent does not get decremented. For a code example see the first answer to my ticket. The problem seems to be that the @owner variable in activerecord/lib/active_record/associations/belongs_to_association.rb holds the child object, not the parent. That''s why it cant have the counter_cache_column and the test: if @owner[counter_cache_name] and not @owner.new_record? fails. I really would appreciate anyone who gives this a try with his installation and reports the results. The original bug (and a patch) about this issue has been posted about 2 years ago! _jeanmartin --~--~---------~--~----~------------~-------~--~----~ 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 15 Jan 2008, at 10:51, jeanmartin wrote:> > I''ve already filed a bug: http://dev.rubyonrails.org/ticket/10804 > I''m still not sure if i''m missing something. >You may have better luck discussing this on the rails-core mailing list, or in #rails-contrib Fred> When I update a child by setting the association method to nil, the > counter of the parent does not get decremented. For a code example see > the first answer to my ticket. > > The problem seems to be that the @owner variable in > activerecord/lib/active_record/associations/belongs_to_association.rb > holds the child object, not the parent. That''s why it cant have the > counter_cache_column and the test: > if @owner[counter_cache_name] and not @owner.new_record? > fails. > > I really would appreciate anyone who gives this a try with his > installation and reports the results. > The original bug (and a patch) about this issue has been posted about > 2 years ago! > > _jeanmartin > >--~--~---------~--~----~------------~-------~--~----~ 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 Jan 15, 12:23 pm, Frederick Cheung <frederick.che...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> You may have better luck discussing this on the rails-core mailing > list, or in #rails-contribYou may be right, to anyone who cares: http://groups.google.com/group/rubyonrails-core/t/9e699ecde0813b13 --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---