bug fixes

This commit is contained in:
JT Smith 2009-10-23 18:11:37 -05:00
parent 81c42d7296
commit 908200869e
3 changed files with 16 additions and 5 deletions

View file

@ -60,6 +60,7 @@ sub import {
#-------------------------------------------------------------------
sub _build {
my ($class, $super, $caller, $definition) = @_;
$class->next::method($super, $caller, $definition);
$class->_install($super, 'getTables', $class->_gen_getTables());
}
@ -68,12 +69,16 @@ sub _gen_getTables {
my $class = shift;
return sub {
my $self = shift;
my %tables;
my %found;
my @tables;
foreach my $property ($self->getProperties) {
my $definition = $self->getProperty($property);
$tables{$definition->{tableName}} = 1;
unless ($found{$definition->{tableName}}) {
push @tables, $definition->{tableName};
}
$found{$definition->{tableName}} = 1;
}
return keys %tables;
return @tables;
};
}