Remove unnecessary join against releases table

This gets rid of the warning:

  DBIx::Class::Storage::DBI::select_single(): Query returned more than one row.  SQL that returns multiple rows is DEPRECATED for ->find and ->single at /home/eelco/Dev/hydra/src/script/../lib/Hydra/Controller/Project.pm line 15
This commit is contained in:
Eelco Dolstra 2014-05-01 13:03:34 +02:00
parent 6c6ce7a781
commit 67c79a16a8

View file

@ -12,10 +12,7 @@ sub projectChain :Chained('/') :PathPart('project') :CaptureArgs(1) {
my ($self, $c, $projectName) = @_;
$c->stash->{params}->{name} //= $projectName;
$c->stash->{project} = $c->model('DB::Projects')->find($projectName, {
join => [ 'releases' ],
order_by => { -desc => "releases.timestamp" },
});
$c->stash->{project} = $c->model('DB::Projects')->find($projectName);
notFound($c, "Project $projectName doesn't exist.")
if !$c->stash->{project} && !($c->action->name eq "project" and $c->request->method eq "PUT");