The personal finance app for everyone (by everyone)
Ruby
fix: keep excluded entries visible in account activity (#2772)
pro3958964817748e16
diff --git a/app/controllers/accounts_controller.rb b/app/controllers/accounts_controller.rbindex 1b84b5416a..1be03dee22 100644--- a/app/controllers/accounts_controller.rb+++ b/app/controllers/accounts_controller.rb@@ -60,8 +60,7 @@ class AccountsController < ApplicationController@tab = params[:tab]@accessible_account_ids = Current.user.accessible_accounts.pluck(:id).to_set@q = params.fetch(:q, {}).permit(:search, status: [])- entries = @account.entries.where(excluded: false).search(@q).reverse_chronological.includes(:entryable)-+ entries = @account.entries.excluding_split_parents.search(@q).reverse_chronological.includes(:entryable)if statement_tab_active?build_statement_tab_datareturn render_statement_tab_frame if statement_tab_frame_request?diff --git a/test/controllers/accounts_controller_test.rb b/test/controllers/accounts_controller_test.rbindex 0b23c54b9e..33a98f04f1 100644--- a/test/controllers/accounts_controller_test.rb+++ b/test/controllers/accounts_controller_test.rb@@ -171,6 +171,16 @@ class AccountsControllerTest < ActionDispatch::IntegrationTestassert_select "turbo-frame##{dom_id(trade_entry)} p.privacy-sensitive", text: expected_amount, count: 1end+ test "account activity keeps excluded entries visible so they can be restored" do+ trade_entry = entries(:trade)+ trade_entry.update!(excluded: true)++ get account_url(accounts(:investment))++ assert_response :success+ assert_select "turbo-frame##{dom_id(trade_entry)}"+ end+test "renders investment account with gains chart view" doget account_url(accounts(:investment), chart_view: "gains")