Bug 28966: (QA follow-up) tmp_holdsqueue no longer an iterator

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This commit is contained in:
Tomás Cohen Arazi 2023-07-26 17:45:41 -03:00
parent 64d63cba2e
commit 2fd6625abc
Signed by: tomascohen
GPG key ID: 0A272EA1B2F3C15F
2 changed files with 3 additions and 3 deletions

View file

@ -891,9 +891,8 @@ This method checks the tmp_holdsqueue to see if this item has been selected for
=cut
sub has_pending_hold {
my ( $self ) = @_;
my $pending_hold = $self->_result->tmp_holdsqueues;
return $pending_hold->count ? 1: 0;
my ($self) = @_;
return $self->_result->tmp_holdsqueue ? 1 : 0;
}
=head3 has_pending_recall {

View file

@ -364,6 +364,7 @@ subtest 'has_pending_hold() tests' => sub {
$dbh->do("INSERT INTO tmp_holdsqueue (surname,borrowernumber,itemnumber) VALUES ('Clamp',42,$itemnumber)");
ok( $item->has_pending_hold, "Yes, we have a pending hold");
$dbh->do("DELETE FROM tmp_holdsqueue WHERE itemnumber=$itemnumber");
$item->discard_changes;
ok( !$item->has_pending_hold, "We don't have a pending hold if nothing in the tmp_holdsqueue");
$schema->storage->txn_rollback;