Bugzilla – Attachment 98272 Details for
Bug 24464
Add K::A::Basket->creator
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 24463: Add a basket_group relationship for baskets
Bug-24463-Add-a-basketgroup-relationship-for-baske.patch (text/plain), 1.83 KB, created by
David Nind
on 2020-02-03 08:00:03 UTC
(
hide
)
Description:
Bug 24463: Add a basket_group relationship for baskets
Filename:
MIME Type:
Creator:
David Nind
Created:
2020-02-03 08:00:03 UTC
Size:
1.83 KB
patch
obsolete
>From 8331236ea4f3ad8983155d36301db03411530c91 Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Mon, 20 Jan 2020 11:56:36 -0300 >Subject: [PATCH] Bug 24463: Add a basket_group relationship for baskets > >This patch aims to bring consistency between the accessor name and the >underlying relationship to ease things when using it from the API. > >To test: >1. Apply this patch >2. Run: > $ kshell > k$ prove t/db_dependent/Koha/Acquisition/Basket.t >=> SUCCESS: Tests pass! No behavior change! >3. Sign off :-D > >https://bugs.koha-community.org/show_bug.cgi?id=24464 >--- > Koha/Acquisition/Basket.pm | 3 ++- > Koha/Schema/Result/Aqbasket.pm | 12 ++++++++++++ > 2 files changed, 14 insertions(+), 1 deletion(-) > >diff --git a/Koha/Acquisition/Basket.pm b/Koha/Acquisition/Basket.pm >index 7a927478b7..acdf544c38 100644 >--- a/Koha/Acquisition/Basket.pm >+++ b/Koha/Acquisition/Basket.pm >@@ -54,7 +54,8 @@ Returns the basket group associated to this basket > > sub basket_group { > my ($self) = @_; >- my $basket_group_rs = $self->_result->basketgroupid; >+ >+ my $basket_group_rs = $self->_result->basket_group; > return unless $basket_group_rs; > return Koha::Acquisition::BasketGroup->_new_from_dbic( $basket_group_rs ); > } >diff --git a/Koha/Schema/Result/Aqbasket.pm b/Koha/Schema/Result/Aqbasket.pm >index efbd6a1d36..e90d3c61e7 100644 >--- a/Koha/Schema/Result/Aqbasket.pm >+++ b/Koha/Schema/Result/Aqbasket.pm >@@ -328,6 +328,18 @@ __PACKAGE__->has_many( > { cascade_copy => 0, cascade_delete => 0 }, > ); > >+__PACKAGE__->belongs_to( >+ "basket_group", >+ "Koha::Schema::Result::Aqbasketgroup", >+ { 'foreign.id' => "self.basketgroupid" }, >+ { >+ is_deferrable => 1, >+ join_type => "LEFT", >+ on_delete => "RESTRICT", >+ on_update => "CASCADE", >+ }, >+); >+ > sub koha_object_class { > 'Koha::Acquisition::Basket'; > } >-- >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 24464
:
97631
|
97632
|
98272
|
98275
|
98276
|
101316
|
101317
|
101409
|
101410
|
101411