Bug 5670: mv housebound_* to search_housebound_*
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Wed, 28 Sep 2016 09:17:46 +0000 (10:17 +0100)
committerKyle M Hall <kyle@bywatersolutions.com>
Fri, 21 Oct 2016 18:18:02 +0000 (18:18 +0000)
I think it's better to prefix the subroutine names used to search with
'search_'.

Signed-off-by: Claire Gravely <claire_gravely@hotmail.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Koha/Patrons.pm
members/housebound.pl
t/db_dependent/Patron/Housebound.t

index 384a25c..13fd091 100644 (file)
@@ -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', {
index 77974e4..2fa0fb0 100755 (executable)
@@ -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.
index 320dd61..a9728f1 100755 (executable)
@@ -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;