* Use ->update({...}) properly.

This commit is contained in:
Eelco Dolstra
2009-03-09 16:22:41 +00:00
parent 717625a5b9
commit 8725dc03ec
5 changed files with 19 additions and 49 deletions

View File

@ -175,9 +175,7 @@ sub restart : Chained('build') PathPart Args(0) {
($build->resultInfo->buildstatus == 3 ||
$build->resultInfo->buildstatus == 4);
$build->finished(0);
$build->timestamp(time());
$build->update;
$build->update({finished => 0, timestamp => time});
$build->resultInfo->delete;

View File

@ -153,11 +153,9 @@ sub updateProject {
} else { # it's an existing jobset
$jobset = ($project->jobsets->search({name => $baseName}))[0];
die unless defined $jobset;
$jobset->name($jobsetName);
$jobset->description($description);
$jobset->nixexprpath($nixExprPath);
$jobset->nixexprinput($nixExprInput);
$jobset->update;
$jobset->update(
{ name => $jobsetName, description => $description
, nixexprpath => $nixExprPath, nixexprinput => $nixExprInput });
}
my %inputNames;
@ -189,9 +187,7 @@ sub updateProject {
} else { # it's an existing jobset
$input = ($jobset->jobsetinputs->search({name => $baseName2}))[0];
die unless defined $input;
$input->name($inputName);
$input->type($inputType);
$input->update;
$input->update({name => $inputName, type => $inputType});
}
# Update the values for this input. Just delete all the

View File

@ -103,9 +103,9 @@ sub updateReleaseSet {
my $releaseSetName = trim $c->request->params->{name};
die "Invalid release set name: $releaseSetName" unless $releaseSetName =~ /^[[:alpha:]]\w*$/;
$releaseSet->name($releaseSetName);
$releaseSet->description(trim $c->request->params->{description});
$releaseSet->update;
$releaseSet->update(
{ name => $releaseSetName
, description => trim $c->request->params->{description} });
$releaseSet->releasesetjobs->delete_all;