From 9296f3f4b429e5ddc10c40dc27a27184861837b3 Mon Sep 17 00:00:00 2001 From: Rick Barrette Date: Tue, 17 Nov 2026 19:48:17 -0500 Subject: [PATCH] Remove orphaned code Issue#children_line_items, #children_line_items_total and #line_items_total (the issue page uses the descendants' total), and the unused notice_added_from key (the "Added from:" memo stays literal: redmine_qbo matches it). Co-Authored-By: Claude Opus 5.5 --- config/locales/en.yml | 1 - lib/line_items/patches/issue_patch.rb | 14 -------------- 2 files changed, 15 deletions(-) diff --git a/config/locales/en.yml b/config/locales/en.yml index 5fd4d50..2f77d02 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -21,7 +21,6 @@ en: label_running_total: "Running Total" label_total: "Total" - notice_added_from: "Added from issue #" label_billed: "Billed" text_line_item_billed: "Already added to a QuickBooks estimate, so it can't be changed or removed." diff --git a/lib/line_items/patches/issue_patch.rb b/lib/line_items/patches/issue_patch.rb index bb0ddc2..ce21939 100644 --- a/lib/line_items/patches/issue_patch.rb +++ b/lib/line_items/patches/issue_patch.rb @@ -75,16 +75,6 @@ module LineItems old_value: old_value, value: value) end - # Returns line items for immediate children - def children_line_items - LineItem.where(issue_id: self.children.pluck(:id)) - end - - # Calculates the total value of all child line items - def children_line_items_total - children_line_items.sum(:line_total) - end - # Returns line items for the entire tree below this issue def descendant_line_items LineItem.where(issue_id: self.descendants.pluck(:id)) @@ -95,10 +85,6 @@ module LineItems descendant_line_items.sum(:line_total) end - def line_items_total - line_items.sum(:line_total) - end - # Applies line item changes from the issue form, enforcing permissions on the server (the form # hides buttons, but a request can be crafted by hand or sent through the API): # - new lines need "Add line items", changes need "Edit line items", removals need "Delete line items"