From: Sebastian Riedel Date: Mon, 27 Sep 2004 00:36:15 +0000 (+0000) Subject: fixed is_public() X-Git-Tag: 2.10~154 X-Git-Url: https://git.decadent.org.uk/gitweb/?a=commitdiff_plain;h=4b6fca4879b54b12587eca6d76d865817fe5e34d;p=maypole.git fixed is_public() git-svn-id: http://svn.maypole.perl.org/Maypole/trunk@208 48953598-375a-da11-a14b-00016c27c3ee --- diff --git a/lib/Maypole.pm b/lib/Maypole.pm index b4e1d62..6063582 100644 --- a/lib/Maypole.pm +++ b/lib/Maypole.pm @@ -136,7 +136,7 @@ sub is_applicable { return DECLINED() unless exists $config->ok_tables->{ $self->{table} }; # Is it public? - return DECLINED unless $r->model_class->is_public( $r->{action} ); + return DECLINED unless $self->model_class->is_public( $self->{action} ); return OK(); } diff --git a/lib/Maypole/Model/Base.pm b/lib/Maypole/Model/Base.pm index b592eaa..b6ef5f4 100644 --- a/lib/Maypole/Model/Base.pm +++ b/lib/Maypole/Model/Base.pm @@ -155,13 +155,13 @@ sub description { "A poorly defined class" } sub is_public { my ( $self, $action ) = @_; my $cv = $self->can($action); - return DECLINED() unless $cv; + return 0 unless $cv; my $attrs = join " ", attributes::get($cv); do { warn "$action not exported" if Maypole->debug; - return DECLINED(); + return 0; } unless $attrs =~ /\bExported\b/i; - return OK; + return 1; } 1;