From e459082b24f66b3673dafcaefb8099d05e9feccd Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Wed, 28 Sep 2016 10:17:46 +0100 Subject: [PATCH] Bug 5670: mv housebound_* to search_housebound_* I think it's better to prefix the subroutine names used to search with 'search_'. Signed-off-by: Claire Gravely --- Koha/Patrons.pm | 8 ++++---- members/housebound.pl | 4 ++-- t/db_dependent/Patron/Housebound.t | 14 +++++++------- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/Koha/Patrons.pm b/Koha/Patrons.pm index 384a25c..13fd091 100644 --- a/Koha/Patrons.pm +++ b/Koha/Patrons.pm @@ -37,13 +37,13 @@ Koha::Patron - Koha Patron Object class =cut -=head3 housebound_choosers +=head3 search_housebound_choosers Returns all Patrons which are Housebound choosers. =cut -sub housebound_choosers { +sub search_housebound_choosers { my ( $self ) = @_; my $cho = $self->_resultset->search ->search_related('borrower_attributes', { @@ -53,13 +53,13 @@ sub housebound_choosers { return Koha::Patrons->_new_from_dbic($cho); } -=head3 housebound_deliverers +=head3 search_housebound_deliverers Returns all Patrons which are Housebound deliverers. =cut -sub housebound_deliverers { +sub search_housebound_deliverers { my ( $self ) = @_; my $del = $self->_resultset->search ->search_related('borrower_attributes', { diff --git a/members/housebound.pl b/members/housebound.pl index 77974e4..2fa0fb0 100755 --- a/members/housebound.pl +++ b/members/housebound.pl @@ -117,8 +117,8 @@ if ( $method eq 'updateconfirm' and $houseboundprofile ) { $method = undef; } elsif ( $method eq 'visit_update_or_create' ) { # We want to edit, edit a visit, so we must pass its details. - $deliverers = Koha::Patrons->new->housebound_deliverers; - $choosers = Koha::Patrons->new->housebound_choosers; + $deliverers = Koha::Patrons->new->search_housebound_deliverers; + $choosers = Koha::Patrons->new->search_housebound_choosers; $houseboundvisit = $visit; } elsif ( $method eq 'visit_delete' and $visit ) { # We want ot delete a specific visit. diff --git a/t/db_dependent/Patron/Housebound.t b/t/db_dependent/Patron/Housebound.t index 320dd61..a9728f1 100755 --- a/t/db_dependent/Patron/Housebound.t +++ b/t/db_dependent/Patron/Housebound.t @@ -37,8 +37,8 @@ is( # patron_choosers and patron_deliverers Tests # Current Patron Chooser / Deliverer count -my $orig_del_count = Koha::Patrons->housebound_deliverers->count; -my $orig_cho_count = Koha::Patrons->housebound_choosers->count; +my $orig_del_count = Koha::Patrons->search_housebound_deliverers->count; +my $orig_cho_count = Koha::Patrons->search_housebound_choosers->count; # We add one, just in case the above is 0, so we're guaranteed one of each. my $patron_chooser = $builder->build({ source => 'Borrower' }); @@ -63,12 +63,12 @@ $builder->build({ }, }); -# Test housebound_choosers -is(Koha::Patrons->housebound_choosers->count, $orig_cho_count + 1, "Correct count of choosers."); -is(Koha::Patrons->housebound_deliverers->count, $orig_del_count + 1, "Correct count of deliverers"); +# Test search_housebound_choosers +is(Koha::Patrons->search_housebound_choosers->count, $orig_cho_count + 1, "Correct count of choosers."); +is(Koha::Patrons->search_housebound_deliverers->count, $orig_del_count + 1, "Correct count of deliverers"); -isa_ok(Koha::Patrons->housebound_choosers->next, "Koha::Patron"); -isa_ok(Koha::Patrons->housebound_deliverers->next, "Koha::Patron"); +isa_ok(Koha::Patrons->search_housebound_choosers->next, "Koha::Patron"); +isa_ok(Koha::Patrons->search_housebound_deliverers->next, "Koha::Patron"); $schema->storage->txn_rollback; -- 2.1.4