[Dbix-class] Defaulting cascade actions to false
Ovid
publiustemp-dbic at yahoo.com
Tue Apr 21 08:48:19 GMT 2009
Hi all,
I need to be able to globally set these attributes on on those resultsource methods which accept them:
{
cascade_delete => 0,
cascade_update => 0,
}
It seems like this is being handled on a method by method basis (see &DBIx::Class::Relationship::HasOne::_has_one for an example), but the code is dense enough (or I am) that I'm not seeing if there is some simple way of overriding this behavior. Right now we're hardcoding this for every single has_one, has_many, belongs_to, etc., and this is leading to unecessary code bloat (and in one case, a bug where a developer forgot to explicitly add this). I know how to override this in our base class, but if there's is an "official" way of handling this, it would be nice to see.
Cheers,
Ovid
--
Buy the book - http://www.oreilly.com/catalog/perlhks/
Tech blog - http://use.perl.org/~Ovid/journal/
Twitter - http://twitter.com/OvidPerl
Official Perl 6 Wiki - http://www.perlfoundation.org/perl6
More information about the DBIx-Class
mailing list