Counter cache

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


This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs