From: "Dmitry V. Sabanin" Date: 2004-10-07T20:30:50+09:00 Subject: Re: [Rails] ActiveRecord modelling problem On Thursday 07 October 2004 19:09, Dmitry V. Sabanin wrote: > On Thursday 07 October 2004 18:44, Andreas Schwarz wrote: > > This is no problem with ActiveRecord: > > > > belongs_to :parent, :class_name => 'Folder', :foreign_key => 'folder_id' > > has_many :children, :class_name => 'Folder', :foreign_key => 'folder_id' > > Super, but I'm not sure how to use that now. How can I add Folders to a > Folder? I've tried folder.folders << another_folder and folder.childrens << > another_folder but with no success. Answering my own question with Andreas help from #rubyonrails, you have to use Folder#children<< to add folder. -- sdmitry -=- Dmitry V. Sabanin MuraveyLabs. Spam Here -> postmaster@sco.com