From 7249c53d755f2eb5b8b5bb471ff49b8dd6f3dbf0 Mon Sep 17 00:00:00 2001 From: Aaron Trevena Date: Wed, 8 Feb 2006 10:43:18 +0000 Subject: [PATCH] update deprecation warning in Changes and fix to M::M::CDBI delete action git-svn-id: http://svn.maypole.perl.org/Maypole/trunk@459 48953598-375a-da11-a14b-00016c27c3ee --- Changes | 5 ++--- lib/Maypole/Model/CDBI.pm | 10 +++++++--- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/Changes b/Changes index d1a3fb9..89e02e7 100644 --- a/Changes +++ b/Changes @@ -11,9 +11,8 @@ Deprecated: Incompatible API changes: Maypole: - - is_applicable() renamed to is_model_applicable(), and returns boolean - instead of a status code. Old-style is_applicable() will still work, - but issues a warning. + - is_applicable() deprecated for is_model_applicable(). is_applicable is + an alias for is_model_applicable now. Maypole::Model - delete and search actions are now deprecated - use do_search and do_delete instead diff --git a/lib/Maypole/Model/CDBI.pm b/lib/Maypole/Model/CDBI.pm index da6f162..3705331 100644 --- a/lib/Maypole/Model/CDBI.pm +++ b/lib/Maypole/Model/CDBI.pm @@ -158,10 +158,14 @@ This method replaces the, now deprecated, delete method provided in prior versio sub delete : Exported { my $self = shift; my ($sub) = (caller(1))[3]; + # So subclasses can still send delete down ... $sub =~ /^(.+)::([^:]+)$/; - # So subclasses can still send search down ... - return ($1 ne "Maypole::Model::Base" && $2 ne "delete") ? - $self->SUPER::search(@_) : $self->do_delete(@_); + if ($1 ne "Maypole::Model::Base" && $2 ne "delete") { + $self->SUPER::delete(@_); + } else { + warn "Maypole::Model::CDBI delete method is deprecated\n"; + $self->do_delete(@_); + } } sub do_delete { -- 2.39.5