[Dbix-class] Cascade deletes
Pedro Melo
melo at simplicidade.org
Sat Mar 6 09:24:29 GMT 2010
Hi,
On Sat, Mar 6, 2010 at 1:07 AM, Bill Moseley <moseley at hank.org> wrote:
> First, is there a way to globally disable cascade deletes? I know I can
> add cascade_delete => 0 to the relationships, but I never want cascade
> deletes in the ORM (I have a database that does that).
I did that once for exactly the same reasons. Created a DBIC component
that overrides add_relationship(). The fourth parameter is the hashref
with the options, set cascade_delete => 0 and call the next method.
Then in the load_components of your base source class, use it.
Bye,
--
Pedro Melo
http://www.simplicidade.org/
xmpp:melo at simplicidade.org
mailto:melo at simplicidade.org
More information about the DBIx-Class
mailing list