Anybody know if self-referential models are even possible at the moment in DataMapper?
cheers, DAZ On Apr 1, 12:36 pm, DAZ <[email protected]> wrote: > Hi, > > I built a simple CMS using Sinatra and DataMapper last year. This had > a self-referential page model (ie pages can have and belong to other > pages). > > You can see the code > here:http://github.com/daz4126/milkshake/blob/master/lib/page.rb > > But the 0.10 version of DataMapper didn't seem to work, specifically > the line that said > > # Associations > belongs_to :parent, :class_name=> "Page", :child_key => > [:parent_id] > has n, :children, :class_name => "Page", :child_key => > [:parent_id] > > Apparently :class_name should be changed to :model, but this breaks. > > Are there any ways to create self referential models in the most > recent version of DataMapper? If not, will it be added sometime soon? > > cheers, > > DAZ -- You received this message because you are subscribed to the Google Groups "DataMapper" 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/datamapper?hl=en.
