frioux/DBIx-Class-Candy — pull request #7 by dionys (2014-10-29 12:29:32+00:00)
Title: Method export_method_aliases is broken

Calling of `export_method_aliases` function raises `Can't locate object method "" via package` error into `gen_rename_proxy` function.

In the lines below `$meth` is empty because `$custom_aliases` is empty:

sub {
my ($class, $name) = @_;
my $meth = $aliases->{$name} || $custom_aliases->{$name};
my $i = $inheritor;
sub { $set_table->(); $i->$meth(@_) }
}

`%custom_aliases` passed into `gen_rename_proxy` as ref `$custom_aliases` function and fall into closure. But after that it clears into `gen_INIT` so stays empty into closure.

# import()
%custom_aliases = %{$custom[1]};
...
$self->gen_rename_proxy($inheritor, $set_table, \%aliases, \%custom_aliases)
...
$self->gen_INIT($perl_version, \%custom_aliases, \@custom_methods, $inheritor),

# gen_INIT()
%$custom_aliases = ();