Displaying 1 result from an estimated 1 matches for "file_count".
2006 Apr 29
2
counter_caching clobbered when preloading association ?
...ng in a tree structure (in this case Bob
Silva''s threaded list). This is the definition:
class Folder < ActiveRecord::Base
acts_as_threaded
has_many :files
end
I would like each parent to have the total count of all the childrens
member. So when inserting a new file I update the file_count following
the parent_id through all the folders until I reach root. (Looking into
the db I see the correct values so this seems to work).
But I hit a problem when trying to read the file_count value from the
database:
the code:
@folders = Folder.find(:all, :order => ''root_id desc,...