Expand annotations to cover all generated methods
This is needed for the next commit, as we need a reliable way to tell gened
methods apart from everything else. Given we will be taking the hit of adding
the attributes, just go ahead and annotate *everything*, to be done with all
auto-generated subs once and for all.
This also solves @vanstyn's long-time gripe of not being able to tell where
in a random schema one has declared m2m "relationships" (a typical customer is
*very* unlikely to be using DBIC::IntrospectableM2M)
As of this commit a typical Result can be introspected for m2m as follows:
~$ perl -Ilib -It/lib -MDBICTest -MPackage::Stash -e '
my $meths = Package::Stash->new("DBICTest::Schema::Artwork")
->get_all_symbols("CODE");
for my $m (sort keys %$meths ) {
print "$m\n" if grep {
$_ =~ /^DBIC_method_is_m2m_sugar/
} attributes::get($meths->{$m});
}
'
While the more involved "complete method map" looks as follows:
~$ perl -Ilib -It/lib -MDBICTest -MPackage::Stash -e '
my $meths = Package::Stash->new("DBICTest::Schema::CD")
->get_all_symbols("CODE");
for my $m (sort keys %$meths ) {
if ( my @attrs = attributes::get($meths->{$m}) ) {
print "\n$m\n";
print " $_\n" for @attrs;
}
}
'