sub action_ajax_add {
my ($self) = @_;
- my $part = SL::DB::Part->new(id => $::form->{part_id})->load(with_objects => [ qw(unit_obj) ]);
+ my $part = SL::DB::Part->new(id => $::form->{part_id})->load(with => [ qw(unit_obj) ]);
my $rs_part = SL::DB::RequirementSpecPart->new(
part => $part,
qty => 1,
my ($self) = @_;
my $db = $self->requirement_spec->db;
- $db->do_transaction(sub {
+ $db->with_transaction(sub {
# Make Emacs happy
1;
my $parts = $::form->{additional_parts} || [];
$_->{position} = $position++ for @{ $parts };
$self->requirement_spec->update_attributes(parts => $parts)->load;
-
- 1;
}) or do {
return $self->js->error(t8('Saving failed. Error message from the database: #1', $db->error))->render;
};