lib/active_record/acts/category.rb
# A category has been manipulated, refresh cache columns
A category has been manipulated, refresh cache columns
A category has been manipulated refresh cache columns
def refresh_cache_after_update
          return if @parent_id_before == self.read_attribute(parent_id_column)
          self.class.refresh_cache_of_branch_with(@parent_id_before) unless @parent_id_before.nil? || @parent_id_before == self.root.id
          self.class.refresh_cache_of_branch_with(self.root)
        end
def refresh_cache_after_update return if @parent_id_before == self . read_attribute ( parent_id_column ) self . class . refresh_cache_of_branch_with ( @parent_id_before ) unless @parent_id_before . nil? || @parent_id_before == self . root . id self . class . refresh_cache_of_branch_with ( self . root ) end
A category has been manipulated, refresh cache columns
A category has been manipulated refresh cache columns
# Parent didn't change, do nothing with cache # If a subcategory has come from another branch, refresh that tree # Refresh current branch in any case