Bugzilla – Attachment 138888 Details for
Bug 31183
Add Koha::Item::Transfers->filter_by_current
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 31183: Add Koha::Item::Transfers->filter_by_current
Bug-31183-Add-KohaItemTransfers-filterbycurrent.patch (text/plain), 1.36 KB, created by
Jonathan Druart
on 2022-08-09 09:34:32 UTC
(
hide
)
Description:
Bug 31183: Add Koha::Item::Transfers->filter_by_current
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2022-08-09 09:34:32 UTC
Size:
1.36 KB
patch
obsolete
>From 9108ffa6fbe786a89e1f76e7190d84cc91dd6bbd Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Mon, 18 Jul 2022 18:33:47 -0300 >Subject: [PATCH] Bug 31183: Add Koha::Item::Transfers->filter_by_current > >This patch introduces the aforementioned method. > >To test: >1. Apply this unit tests patch >2. Run: > $ kshell > k$ prove t/db_dependent/Koha/Item/Transfers.t >=> FaIL: method not defined? >3. Apply this patch >4. Repeat 2 >=> SUCCESS: Tests pass! >5. Sign off :-D > >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> > >Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >--- > Koha/Item/Transfers.pm | 19 ++++++++++++++++++- > 1 file changed, 18 insertions(+), 1 deletion(-) > >diff --git a/Koha/Item/Transfers.pm b/Koha/Item/Transfers.pm >index be5c0e098c0..a5417ea75c1 100644 >--- a/Koha/Item/Transfers.pm >+++ b/Koha/Item/Transfers.pm >@@ -30,10 +30,27 @@ Koha::Item::Transfers - Koha Item Transfer Object set class > > =head1 API > >-=head2 Class Methods >+=head2 Class methods >+ >+=head3 filter_by_current >+ >+ my $current_transfers = $transfers->filter_by_current; >+ >+Filters out completed transfers from the resultset. > > =cut > >+sub filter_by_current { >+ my ( $self ) = @_; >+ >+ return $self->search( >+ { >+ datearrived => undef, >+ datecancelled => undef, >+ } >+ ); >+} >+ > =head3 type > > =cut >-- >2.25.1
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 31183
:
137851
|
137852
|
137853
|
137944
|
137945
|
137946
|
138887
| 138888 |
138889