Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Add check to [zoom] for proper table specifications.
  • Loading branch information
racke committed Sep 13, 2010
1 parent 2b5bf0c commit 1f2eff7
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lib/WellWell/Zoom.pm
Expand Up @@ -64,12 +64,20 @@ sub zoom {
$bref->{query_is_sql} = 1;

# now determine which fields are needed
my %tables;

while (($key, $value) = each %{$sref->{params}->{$name}->{hash}}) {
if (exists $value->{table}) {
$tables{$value->{table}} = 1;
push @{$bref->{columns}->{$value->{table}}}, $value->{field} || $key;
}
}

unless (keys %tables) {
Vend::Tags->error({name => 'zoom', set => 'Missing tables in specification.'});
return;
}

($sql, $bind) = build_select(%$bref);

$sth = $bref->{dbh}->prepare($sql);
Expand Down

0 comments on commit 1f2eff7

Please sign in to comment.