We need to use the DBIx::Class relationship to retrieve the patron category. It will be more convenient to have a Koha::Patron->category method to retrieve the category of a given patron.
Created attachment 57211 [details] [review] Bug 17555: Add Koha::Patron->category We need to use the DBIx::Class relationship to retrieve the patron category. It is more convenient to have a Koha::Patron->category method to retrieve the category of a given patron. Test plan: Make sure that the tests in t/db_dependent/Koha/Patron* return green
(In reply to Jonathan Druart from comment #1) > Test plan: > Make sure that the tests in t/db_dependent/Koha/Patron* return green Note that t/db_dependent/Koha/Patron/Messages.t is broken in master.
Created attachment 57224 [details] [review] [SIGNED-OFF] Bug 17555: Add Koha::Patron->category We need to use the DBIx::Class relationship to retrieve the patron category. It is more convenient to have a Koha::Patron->category method to retrieve the category of a given patron. Test plan: Make sure that the tests in t/db_dependent/Koha/Patron* return green Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
With combination of 1st patch from 17558 also Messages.t pass...
Why do u use Koha::Patron::Category->_new_from_dbic instead of Koha::Patron::Categories->find($self->categorycode)?
(In reply to Tomás Cohen Arazi from comment #5) > Why do u use Koha::Patron::Category->_new_from_dbic instead of > Koha::Patron::Categories->find($self->categorycode)? Because we want to use the DBIx::Class relationship
Created attachment 57495 [details] [review] Bug 17555: Add Koha::Patron->category We need to use the DBIx::Class relationship to retrieve the patron category. It is more convenient to have a Koha::Patron->category method to retrieve the category of a given patron. Test plan: Make sure that the tests in t/db_dependent/Koha/Patron* return green Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Pushed to master for 16.11, thanks Jonathan!
enhancement, passing for 16.05