On Fri, Mar 27, 2009 at 4:33 PM, Paul A. <[email protected]> wrote: > > Hi, > > I would like to make a relation using a different way then the classic > belongs_to/has_many association. Instead of this, I would like to save > the foreign key in the parent class as a list of ids. > > For instance, we can consider 2 models: File and Folder. > Basically, we could add in File model this method: folder_id. > > But can we do the same with a list of file's ids stored in this folder's > method: file_ids?
Once you do your has_many :files and belongs_to :folder relationships, you get folder.file_ids for free. -- Greg Donald http://destiney.com/ --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---

