From: Jonathan Druart Date: Tue, 28 Mar 2017 14:39:09 +0000 (-0300) Subject: Bug 17828: Use Koha::Patron::Attributes instead of _resultset X-Git-Tag: v17.05.00~365 X-Git-Url: http://koha-dev.rot13.org:8081/gitweb/?a=commitdiff_plain;h=dd54e970a593e758fa7d914e1241b22196cb6f7c;p=srvgit Bug 17828: Use Koha::Patron::Attributes instead of _resultset Signed-off-by: Jonathan Druart Signed-off-by: Kyle M Hall --- diff --git a/Koha/Patron/Attribute.pm b/Koha/Patron/Attribute.pm index 52eb9c17f9..79b7eaf61c 100644 --- a/Koha/Patron/Attribute.pm +++ b/Koha/Patron/Attribute.pm @@ -109,8 +109,7 @@ sub _check_repeatable { my $self = shift; if ( !$self->type->repeatable ) { - my $attr_count - = Koha::Database->new->schema->resultset( $self->_type )->search( + my $attr_count = Koha::Patron::Attributes->search( { borrowernumber => $self->borrowernumber, code => $self->code } @@ -135,8 +134,7 @@ sub _check_unique_id { my $self = shift; if ( $self->type->unique_id ) { - my $unique_count - = Koha::Database->new->schema->resultset( $self->_type ) + my $unique_count = Koha::Patron::Attributes ->search( { code => $self->code, attribute => $self->attribute } ) ->count; Koha::Exceptions::Patron::Attribute::UniqueIDConstraint->throw()