https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42587 --- Comment #5 from David Nind <david@davidnind.com> --- Created attachment 205266 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=205266&action=edit Bug 42587: Use DBIC coderef relationship for Koha::Patron->overdues Adds a DBIC coderef relationship 'overdues' on Borrower that filters issues.date_due < NOW() at the SQL level. Updates Koha::Patron->overdues to delegate to this relationship instead of filtering in Perl. This is a refactor with no behavior change. The filter logic now lives in a single place (the DBIC relationship), which both the Koha method and the +count subquery infrastructure can use. Test plan: 1. Run tests before applying: $ prove t/db_dependent/Koha/Patron.t => SUCCESS: Tests pass 2. Apply patch 3. Run tests again: $ prove t/db_dependent/Koha/Patron.t => SUCCESS: Tests still pass (no behavior change) 4. Sign off :-D Assisted-by: Sonnet 4.6 (Anthropic) Signed-off-by: David Nind <david@davidnind.com> -- You are receiving this mail because: You are watching all bug changes.