[Dbix-class] Defaulting cascade actions to false

Alexander Hartmaier alexander.hartmaier at t-systems.at
Tue Apr 21 10:18:16 GMT 2009


+1

--
BR Alex


Am Dienstag, den 21.04.2009, 10:48 +0200 schrieb Ovid:
> 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
>
>
> _______________________________________________
> List: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class
> IRC: irc.perl.org#dbix-class
> SVN: http://dev.catalyst.perl.org/repos/bast/DBIx-Class/
> Searchable Archive: http://www.grokbase.com/group/dbix-class@lists.scsys.co.uk


*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*
T-Systems Austria GesmbH   Rennweg 97-99, 1030 Wien
Handelsgericht Wien, FN 79340b
*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*
Notice: This e-mail contains information that is confidential and may be privileged.
If you are not the intended recipient, please notify the sender and then
delete this e-mail immediately.
*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*



More information about the DBIx-Class mailing list