Bugzilla – Attachment 119527 Details for
Bug 21549
Lock expired patron accounts after x days
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 21549: Make filter_by_last_update returns a Koha::Objects-based object
Bug-21549-Make-filterbylastupdate-returns-a-KohaOb.patch (text/plain), 1.57 KB, created by
Marcel de Rooy
on 2021-04-13 11:12:50 UTC
(
hide
)
Description:
Bug 21549: Make filter_by_last_update returns a Koha::Objects-based object
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2021-04-13 11:12:50 UTC
Size:
1.57 KB
patch
obsolete
>From 086bbb61aec285ef545dabdf1a4146af8e80504b Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Mon, 12 Apr 2021 16:22:55 +0200 >Subject: [PATCH] Bug 21549: Make filter_by_last_update returns a > Koha::Objects-based object >Content-Type: text/plain; charset=utf-8 > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >--- > Koha/Objects.pm | 2 +- > t/db_dependent/Koha/Objects.t | 4 ++++ > 2 files changed, 5 insertions(+), 1 deletion(-) > >diff --git a/Koha/Objects.pm b/Koha/Objects.pm >index ed9366c010..fab6f9046d 100644 >--- a/Koha/Objects.pm >+++ b/Koha/Objects.pm >@@ -289,7 +289,7 @@ sub filter_by_last_update { > $conditions->{'<='} = $dtf->format_date( $to ); > } > >- return $self->_resultset->search( >+ return $self->search( > { > $timestamp_column_name => $conditions > } >diff --git a/t/db_dependent/Koha/Objects.t b/t/db_dependent/Koha/Objects.t >index 8e046e9afc..554b631741 100755 >--- a/t/db_dependent/Koha/Objects.t >+++ b/t/db_dependent/Koha/Objects.t >@@ -1097,6 +1097,10 @@ subtest "filter_by_last_update" => sub { > ); > }; > >+ my $filtered_patrons = $patrons->filter_by_last_update( >+ { timestamp_column_name => 'updated_on', days => 2 } ); >+ is( ref($filtered_patrons), 'Koha::Patrons', 'filter_by_last_update must return a Koha::Objects-based object' ); >+ > my $count = $patrons->filter_by_last_update( > { timestamp_column_name => 'updated_on', days => 2 } )->count; > is( $count, 3, '3 patrons have been updated before the last 2 days (exclusive)' ); >-- >2.11.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 21549
:
108000
|
108001
|
111480
|
111481
|
113914
|
113915
|
118493
|
118494
|
118495
|
118496
|
118517
|
118518
|
118519
|
118520
|
118521
|
119457
|
119458
|
119459
|
119460
|
119461
|
119462
|
119463
|
119464
|
119525
|
119526
| 119527