Bugzilla – Attachment 131854 Details for
Bug 30294
Rename Koha::Recall->* used relationship names
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 30294: Rename Koha::Recall->* used relationship names
Bug-30294-Rename-KohaRecall--used-relationship-nam.patch (text/plain), 2.12 KB, created by
Fridolin Somers
on 2022-03-18 06:51:09 UTC
(
hide
)
Description:
Bug 30294: Rename Koha::Recall->* used relationship names
Filename:
MIME Type:
Creator:
Fridolin Somers
Created:
2022-03-18 06:51:09 UTC
Size:
2.12 KB
patch
obsolete
>From 576e09ed1a41a865577461825eadc74f81cd367f Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Mon, 14 Mar 2022 14:47:36 -0300 >Subject: [PATCH] Bug 30294: Rename Koha::Recall->* used relationship names > >This patch renames the underlaying relationship names used in the >'patron' and 'library' subs so they are more clearly prefetchable and >also enabling them to be embeddable and searchable through an eventual >API route for recalls. > >To test: >1. Apply the patch >2. Run: > $ kshell > k$ prove t/db_dependent/Koha/Recall* >=> SUCCESS: Tests pass, nothing really changes >3. Sign off :-D > >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> >Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com> >--- > Koha/Recall.pm | 4 ++-- > Koha/Schema/Result/Recall.pm | 4 ++-- > 2 files changed, 4 insertions(+), 4 deletions(-) > >diff --git a/Koha/Recall.pm b/Koha/Recall.pm >index c39e9b946a..b5d0c2c5c4 100644 >--- a/Koha/Recall.pm >+++ b/Koha/Recall.pm >@@ -78,7 +78,7 @@ Returns the related Koha::Patron object for this recall. > > sub patron { > my ( $self ) = @_; >- my $patron_rs = $self->_result->borrower; >+ my $patron_rs = $self->_result->patron; > return unless $patron_rs; > return Koha::Patron->_new_from_dbic( $patron_rs ); > } >@@ -93,7 +93,7 @@ Returns the related Koha::Library object for this recall. > > sub library { > my ( $self ) = @_; >- my $library_rs = $self->_result->branch; >+ my $library_rs = $self->_result->library; > return unless $library_rs; > return Koha::Library->_new_from_dbic( $library_rs ); > } >diff --git a/Koha/Schema/Result/Recall.pm b/Koha/Schema/Result/Recall.pm >index 0b53e38299..a8468a76f8 100644 >--- a/Koha/Schema/Result/Recall.pm >+++ b/Koha/Schema/Result/Recall.pm >@@ -312,14 +312,14 @@ __PACKAGE__->belongs_to( > ); > > __PACKAGE__->belongs_to( >- "borrower", >+ "patron", > "Koha::Schema::Result::Borrower", > { borrowernumber => "borrowernumber" }, > { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" }, > ); > > __PACKAGE__->belongs_to( >- "branch", >+ "library", > "Koha::Schema::Result::Branch", > { branchcode => "branchcode" }, > { >-- >2.35.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 30294
:
131670
|
131854
|
131964