Hi, I have two models, employees and departments, and i am using counter_cache to count the number of employees in a department. This works great, but employees can change their departments, and the counter cache does not get updated to reflect this. Is their a built in way to do this, or do i have to implement my own before_save hook thanks --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Hi, Please post this questions to the rubyonrails-talk list. This list is for discussing the development of Rails itself. On 8/21/07, foaud167 <f.mardini@gmail.com> wrote:> > Hi, > I have two models, employees and departments, and i am using > counter_cache to count the number of employees in a department. > This works great, but employees can change their departments, and the > counter cache does not get updated to reflect this. > Is their a built in way to do this, or do i have to implement my own > before_save hook > > thanks > > > > >-- Cheers! - Pratik http://m.onkey.org --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
On Aug 21, 12:21 pm, Pratik <pratikn...@gmail.com> wrote:> Hi, > > Please post this questions to the rubyonrails-talk list. This list is > for discussing the development of Rails itself. >Oh, sorry, I actually thought i did that> On 8/21/07, foaud167 <f.mard...@gmail.com> wrote: > > > > > Hi, > > I have two models, employees and departments, and i am using > > counter_cache to count the number of employees in a department. > > This works great, but employees can change their departments, and the > > counter cache does not get updated to reflect this. > > Is their a built in way to do this, or do i have to implement my own > > before_save hook > > > thanks > > -- > Cheers! > - Pratikhttp://m.onkey.org--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---