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: v1.90_01~14 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=6bbe13e99769ef04d6cda7a4a6ac6968b535435f;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 4cc007a..dda7fc5 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}: $@";