Bug 28130: (QA follow-up) Use schema result to fetch alerts to allow for prefetch
Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This commit is contained in:
parent
e790f75c0d
commit
73739dd0b6
1 changed files with 1 additions and 2 deletions
|
@ -2710,8 +2710,7 @@ Return a Koha::Subscriptions object containing subscriptions for which the patro
|
|||
sub alert_subscriptions {
|
||||
my ( $self ) = @_;
|
||||
|
||||
my $schema = Koha::Database->new->schema;
|
||||
my @alerts = $schema->resultset('Alert')->search({ borrowernumber => $self->borrowernumber });
|
||||
my @alerts = $self->_result->alerts;
|
||||
my @subscription_ids = map { $_->externalid } @alerts;
|
||||
|
||||
return Koha::Subscriptions->search({ subscriptionid => \@subscription_ids });
|
||||
|
|
Loading…
Reference in a new issue