Hey DAZ,

You might check out snusnu's dm-is-self_referential:
http://github.com/snusnu/dm-is-self_referential

<http://github.com/snusnu/dm-is-self_referential>I'm not positive whether
it's currently up to date, but it'd be worth taking a poke around.

-Ted

On Wed, Apr 21, 2010 at 7:24 PM, DAZ <[email protected]> wrote:

> 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]<datamapper%[email protected]>
> .
> For more options, visit this group at
> http://groups.google.com/group/datamapper?hl=en.
>
>

-- 
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.

Reply via email to