Add eager fetching of relations and enable that for jobset->jobsetinputs

Signed-off-by: Shea Levy <shea@shealevy.com>
This commit is contained in:
Shea Levy
2013-10-24 13:18:36 -04:00
parent ec6568f9b7
commit 917660442e
4 changed files with 20 additions and 5 deletions

View File

@ -23,6 +23,11 @@ sub TO_JSON {
$json{$relname} = [ map { $_->$key } $self->$relname ];
}
foreach my $relname (keys %{$hint->{eager_relations}}) {
my $key = $hint->{eager_relations}->{$relname};
$json{$relname} = { map { $_->$key => $_ } $self->$relname };
}
return \%json;
} else {
my $json = { $self->get_columns };