From: Ivan Kohler Date: Sat, 17 Jan 2015 02:38:06 +0000 (-0800) Subject: Merge branch 'fix_category_table' of https://github.com/jgoodman/Freeside into jgoodm... X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=commitdiff_plain;h=e1cac73de0b294dd3baeb792509fbf089fe981d3;hp=b7cf1606a66cca95e3540f803ffa66d223f23a40 Merge branch 'fix_category_table' of https://github.com/jgoodman/Freeside into jgoodman-fix_category_table --- diff --git a/FS/FS/class_Common.pm b/FS/FS/class_Common.pm index 455cb9f1a..01048ec65 100644 --- a/FS/FS/class_Common.pm +++ b/FS/FS/class_Common.pm @@ -122,14 +122,15 @@ sub _target_table { sub _target_column { 'classnum'; } -use vars qw( $_category_table ); +use vars qw( %_category_table ); sub _category_table { - return $_category_table if $_category_table; my $self = shift; - $_category_table = $self->table; - $_category_table =~ s/class/category/ # s/_class$/_category/ - or die "can't determine an automatic category table for $_category_table"; - $_category_table; + return $_category_table{ ref $self } ||= do { + my $category_table = $self->table; + $category_table =~ s/class/category/ # s/_class$/_category/ + or die "can't determine an automatic category table for $category_table"; + $category_table; + } } =head1 BUGS