From 2722254be9a6e11cd70b8ea0ca6440f6b32614ba Mon Sep 17 00:00:00 2001 From: Zach Gollwitzer Date: Tue, 5 Nov 2024 19:31:24 -0500 Subject: [PATCH] Sync account after balance deletion - Fixes #1416 - Fixes timezone bugs in forms --- app/controllers/transactions_controller.rb | 1 + app/views/account/trades/_form.html.erb | 2 +- app/views/account/valuations/_form.html.erb | 2 +- app/views/transactions/_form.html.erb | 2 +- 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/app/controllers/transactions_controller.rb b/app/controllers/transactions_controller.rb index 6360bd19..b1733585 100644 --- a/app/controllers/transactions_controller.rb +++ b/app/controllers/transactions_controller.rb @@ -37,6 +37,7 @@ class TransactionsController < ApplicationController def bulk_delete destroyed = Current.family.entries.destroy_by(id: bulk_delete_params[:entry_ids]) + destroyed.map(&:account).uniq.each(&:sync_later) redirect_back_or_to transactions_url, notice: t(".success", count: destroyed.count) end diff --git a/app/views/account/trades/_form.html.erb b/app/views/account/trades/_form.html.erb index f8c4033a..41180a20 100644 --- a/app/views/account/trades/_form.html.erb +++ b/app/views/account/trades/_form.html.erb @@ -12,7 +12,7 @@ - <%= form.date_field :date, label: true, value: Date.current %> + <%= form.date_field :date, label: true, value: Date.today %>