DM Constraints will do the trick, Im actually pushing some code later
today so dm constraints will support :through => Resource which it
currently doesn't.  But for 1:M it is the way to go

On Feb 11, 11:02 am, Nick Chistyakov <[email protected]> wrote:
> Try dm-constraints from dm-more gem
>
> br,
> Nick
>
> On Wed, Feb 11, 2009 at 9:16 PM, Ted Han <[email protected]> wrote:
>
> > i don't think Datamapper has an implicit hook for something like that
> > (atm, at least.  it probably should :P )
>
> > You can use the builtin hooks for a class to reap the children of the
> > object before the object gets deleted.  Check out:
> >http://datamapper.org/doku.php?id=docs:hooks
>
> > On Wed, Feb 11, 2009 at 12:42 PM, Praveen <[email protected]> wrote:
>
> > > Hi All
> > > Trying to port an activerecord based app to DM and can't seem to find
> > > an equivalent of
> > > has_many :children, :dependent => :destroy
> > > in DM. I tried
> > > has n :children, :dependent => :destroy
>
> > > but it gives and error : ArgumentError: Unknown property 'dependent'
> > > when I try to access the collection like parent.children()
>
> > > What's the recommended way to do :dependent in DM?
>
> > > thanks
--~--~---------~--~----~------------~-------~--~----~
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