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