From ee352dada4e5f11d522ad04670cdfb08ba594849 Mon Sep 17 00:00:00 2001 From: maverick <23173570+DataEnginr@users.noreply.github.com> Date: Wed, 29 Apr 2026 22:05:00 +0530 Subject: [PATCH] Added ability to bulk-edit transaction names for multiple selected transactions (#1553) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Added ability to bulk-edit transaction names for multiple selected transactions. * Added ability to bulk-edit transaction names for multiple selected transactions. * Added ability to bulk-edit transaction names for multiple selected transactions. * Lint, minimize changes --------- Co-authored-by: Juan José Mata --- app/controllers/transactions/bulk_updates_controller.rb | 2 +- app/models/entry.rb | 1 + app/views/transactions/bulk_updates/new.html.erb | 1 + config/locales/views/transactions/en.yml | 4 ++++ 4 files changed, 7 insertions(+), 1 deletion(-) diff --git a/app/controllers/transactions/bulk_updates_controller.rb b/app/controllers/transactions/bulk_updates_controller.rb index 82d4c6ddf..133452f21 100644 --- a/app/controllers/transactions/bulk_updates_controller.rb +++ b/app/controllers/transactions/bulk_updates_controller.rb @@ -16,7 +16,7 @@ class Transactions::BulkUpdatesController < ApplicationController private def bulk_update_params params.require(:bulk_update) - .permit(:date, :notes, :category_id, :merchant_id, entry_ids: [], tag_ids: []) + .permit(:date, :notes, :name, :category_id, :merchant_id, entry_ids: [], tag_ids: []) end # Check if tag_ids was explicitly provided in the request. diff --git a/app/models/entry.rb b/app/models/entry.rb index 48b216f36..042ea6957 100644 --- a/app/models/entry.rb +++ b/app/models/entry.rb @@ -440,6 +440,7 @@ class Entry < ApplicationRecord bulk_attributes = { date: bulk_update_params[:date], notes: bulk_update_params[:notes], + name: bulk_update_params[:name], entryable_attributes: { category_id: bulk_update_params[:category_id], merchant_id: bulk_update_params[:merchant_id] diff --git a/app/views/transactions/bulk_updates/new.html.erb b/app/views/transactions/bulk_updates/new.html.erb index 0aee4d890..7affac23e 100644 --- a/app/views/transactions/bulk_updates/new.html.erb +++ b/app/views/transactions/bulk_updates/new.html.erb @@ -10,6 +10,7 @@ <%= render DS::Disclosure.new(title: "Transactions", open: true) do %>
+ <%= form.text_field :name, label: t("transactions.bulk_updates.new.name_label"), placeholder: t("transactions.bulk_updates.new.name_placeholder") %> <%= form.collection_select :category_id, Current.family.categories.alphabetically, :id, :name, { prompt: "Select a category", label: "Category", class: "text-subdued" } %> <%= form.collection_select :merchant_id, Current.family.available_merchants_for(Current.user).alphabetically, :id, :name, { prompt: "Select a merchant", label: "Merchant", class: "text-subdued" } %> <%= form.select :tag_ids, Current.family.tags.alphabetically.pluck(:name, :id), { include_blank: "None", multiple: true, label: "Tags", include_hidden: false } %> diff --git a/config/locales/views/transactions/en.yml b/config/locales/views/transactions/en.yml index cc5775645..8336576ee 100644 --- a/config/locales/views/transactions/en.yml +++ b/config/locales/views/transactions/en.yml @@ -1,6 +1,10 @@ --- en: transactions: + bulk_updates: + new: + name_label: Name + name_placeholder: Enter a name that will be applied to selected transactions unknown_name: Unknown transaction selection_bar: duplicate: Duplicate