@@ -, +, @@ filter_by_expiration_date --- Koha/Patrons.pm | 6 +++--- misc/cronjobs/cleanup_database.pl | 2 +- t/db_dependent/Koha/Patrons.t | 10 +++++----- 3 files changed, 9 insertions(+), 9 deletions(-) --- a/Koha/Patrons.pm +++ a/Koha/Patrons.pm @@ -233,15 +233,15 @@ sub delete { return $patrons_deleted; } -=head3 filter_by_dateexpiry +=head3 filter_by_expiration_date - Koha::Patrons->filter_by_dateexpiry{{ days => $x }); + Koha::Patrons->filter_by_expiration_date{{ days => $x }); Returns set of Koha patron objects expired $x days. =cut -sub filter_by_dateexpiry { +sub filter_by_expiration_date { my ( $class, $params ) = @_; return $class->filter_by_last_update( --- a/misc/cronjobs/cleanup_database.pl +++ a/misc/cronjobs/cleanup_database.pl @@ -405,7 +405,7 @@ if($allDebarments) { # Lock expired patrons? if( defined $lock_days && $lock_days ne q{} ) { say "Start locking expired patrons" if $verbose; - my $expired_patrons = Koha::Patrons->filter_by_dateexpiry({ days => $lock_days })->search({ login_attempts => { '!=' => -1 } }); + my $expired_patrons = Koha::Patrons->filter_by_expiration_date({ days => $lock_days })->search({ login_attempts => { '!=' => -1 } }); my $count = $expired_patrons->count; $expired_patrons->lock({ remove => 1 }) if $confirm; if( $verbose ) { --- a/t/db_dependent/Koha/Patrons.t +++ a/t/db_dependent/Koha/Patrons.t @@ -1798,16 +1798,16 @@ subtest '->set_password' => sub { }; $schema->storage->txn_begin; -subtest 'filter_by_dateexpiry' => sub { +subtest 'filter_by_expiration_date' => sub { plan tests => 3; - my $count1 = Koha::Patrons->filter_by_dateexpiry({ days => 28 })->count; + my $count1 = Koha::Patrons->filter_by_expiration_date({ days => 28 })->count; my $patron1 = $builder->build_object({ class => 'Koha::Patrons' }); $patron1->dateexpiry( dt_from_string->subtract(days => 27) )->store; - is( Koha::Patrons->filter_by_dateexpiry({ days => 28 })->count, $count1, 'No more expired' ); + is( Koha::Patrons->filter_by_expiration_date({ days => 28 })->count, $count1, 'No more expired' ); $patron1->dateexpiry( dt_from_string->subtract(days => 28) )->store; - is( Koha::Patrons->filter_by_dateexpiry({ days => 28 })->count, $count1 + 1, 'One more expired' ); + is( Koha::Patrons->filter_by_expiration_date({ days => 28 })->count, $count1 + 1, 'One more expired' ); $patron1->dateexpiry( dt_from_string->subtract(days => 29) )->store; - is( Koha::Patrons->filter_by_dateexpiry({ days => 28 })->count, $count1 + 1, 'Same number again' ); + is( Koha::Patrons->filter_by_expiration_date({ days => 28 })->count, $count1 + 1, 'Same number again' ); }; subtest 'search_unsubscribed' => sub { --