https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42587 --- Comment #2 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- Created attachment 199493 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=199493&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) -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.