From: Simon Elliott Date: Thu, 16 Oct 2008 13:41:18 +0000 (+0000) Subject: patch ->delete to die if args X-Git-Tag: v0.08240~320 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=cc94c44578d9546b0ac6c11c11f28c57c714321a;p=dbsrgits%2FDBIx-Class.git patch ->delete to die if args --- diff --git a/Changes b/Changes index f709857..e0fe223 100644 --- a/Changes +++ b/Changes @@ -1,5 +1,5 @@ Revision history for DBIx::Class - + - delete throws exception if passed arguments to prevent drunken mishaps. (purge) - Fix storage to copy scalar conds before regexping to avoid trying to modify a constant in odd edge cases - Related resultsets on uninserted objects are now empty diff --git a/lib/DBIx/Class/ResultSet.pm b/lib/DBIx/Class/ResultSet.pm index e59b88a..e240c64 100644 --- a/lib/DBIx/Class/ResultSet.pm +++ b/lib/DBIx/Class/ResultSet.pm @@ -1297,7 +1297,8 @@ to run. See also L. sub delete { my ($self) = @_; - + $self->throw_exception("Delete should not be passed any arguments") + if $_[1]; my $cond = $self->_cond_for_update_delete; $self->result_source->storage->delete($self->result_source, $cond);