Bug 24463

Summary: Consistent accessor-relationship naming for basket_group in Basket.pm
Product: Koha Reporter: Tomás Cohen Arazi <tomascohen>
Component: Architecture, internals, and plumbingAssignee: Tomás Cohen Arazi <tomascohen>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low CC: 1joynelson, jonathan.druart, katrin.fischer
Version: master   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Trivial patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
20.05.00
Bug Depends on:    
Bug Blocks: 24464    
Attachments: Bug 24463: Add a basket_group relationship for baskets
Bug 24463: Add a basket_group relationship for baskets
Bug 24463: Add a basket_group relationship for baskets

Description Tomás Cohen Arazi 2020-01-20 14:53:41 UTC
We agreed there needs to be consistency. This will be a blocker for dealing with related data from the API (prefetching, filternig, etC).
Comment 1 Tomás Cohen Arazi 2020-01-20 14:58:22 UTC
Created attachment 97628 [details] [review]
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
Comment 2 David Nind 2020-02-03 08:04:53 UTC
Created attachment 98273 [details] [review]
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

Signed-off-by: David Nind <david@davidnind.com>
Comment 3 Jonathan Druart 2020-02-04 11:05:04 UTC
If we agree with such naming conventions (ie. create the rs when the DB column is poorly named), I think we should have a global plan, and do it widely. I do not think we should have 1 bug report per rs.
Comment 4 Tomás Cohen Arazi 2020-02-04 13:15:52 UTC
(In reply to Jonathan Druart from comment #3)
> If we agree with such naming conventions (ie. create the rs when the DB
> column is poorly named), I think we should have a global plan, and do it
> widely. I do not think we should have 1 bug report per rs.

I started adding them as needed on the bugs that will actually take advantage of it.
Comment 5 Jonathan Druart 2020-02-26 14:32:41 UTC
(In reply to Tomás Cohen Arazi from comment #4)
> (In reply to Jonathan Druart from comment #3)
> > If we agree with such naming conventions (ie. create the rs when the DB
> > column is poorly named), I think we should have a global plan, and do it
> > widely. I do not think we should have 1 bug report per rs.
> 
> I started adding them as needed on the bugs that will actually take
> advantage of it.

But you don't, this bug report only renames the DBIC rs.
Comment 6 Katrin Fischer 2020-03-22 11:46:01 UTC
I see that this is the start of a tree of patches - Joubu, can we continue here?
Comment 7 Jonathan Druart 2020-03-23 09:55:06 UTC
Created attachment 101408 [details] [review]
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

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 8 Martin Renvoize 2020-03-24 09:30:07 UTC
Nice work everyone!

Pushed to master for 20.05
Comment 9 Joy Nelson 2020-04-03 21:26:33 UTC
enhancement not backported to 19.11.x