From: Matt S Trout Date: Mon, 7 Oct 2019 01:00:10 +0000 (+0000) Subject: singular methods as readers never worked, mst is an idiot. fixed. X-Git-Tag: v2.000000~3^2~35 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=f34df2ab4362fcfb4ae0ccfce2369db7b0070495;p=dbsrgits%2FSQL-Abstract.git singular methods as readers never worked, mst is an idiot. fixed. --- diff --git a/lib/SQL/Abstract.pm b/lib/SQL/Abstract.pm index a4e7193..9de1ceb 100644 --- a/lib/SQL/Abstract.pm +++ b/lib/SQL/Abstract.pm @@ -363,8 +363,11 @@ BEGIN { my $name = join '_', reverse split '_', $type; my $singular = "${type}er"; - eval qq{sub ${singular} { shift->${singular}s(\@_) }; 1 } - or die "Method builder failed for ${singular}: $@"; + eval qq{sub ${singular} { + my \$self = shift; + return \$self->_ext_rw('${name}', \@_) if \@_ == 1; + return \$self->${singular}s(\@_) + }; 1 } or die "Method builder failed for ${singular}: $@"; eval qq{sub wrap_${singular} { shift->wrap_${singular}s(\@_) }; 1 } or die "Method builder failed for wrap_${singular}: $@";