Add customizable menu order for user accounts (#44)

* Add customizable menu order for user accounts

Introduces a MenuOrder model and concern to allow users to select their preferred account ordering (by name or balance, ascending or descending). Adds a default_order field to users, updates user preferences UI, and applies the selected order to balance sheet account listings.

* Rename MenuOrder to AccountOrder and update user order field

Refactors the MenuOrder model to AccountOrder and updates all references accordingly. Replaces the user's default_order field with default_account_order, including migration changes, validations, and form fields. Updates localization and schema to reflect the new naming.

* Update balance_sheet.rb

* Fix for nil Current.user when rake runs in balance_sheet model

---------

Signed-off-by: Aluisio Pereira <oaluiser@gmail.com>
Co-authored-by: Juan José Mata <juanjo.mata@gmail.com>
This commit is contained in:
Aluisio Pereira
2025-08-11 17:58:44 -03:00
committed by GitHub
parent dd0cb60b56
commit 6d4a5dd743
9 changed files with 114 additions and 5 deletions

View File

@@ -30,6 +30,11 @@
{ label: t(".default_period") },
{ data: { auto_submit_form_target: "auto" } } %>
<%= form.select :default_account_order,
AccountOrder.all.map { |order| [ order.label, order.key ] },
{ label: t(".default_account_order") },
{ data: { auto_submit_form_target: "auto" } } %>
<%= family_form.select :country,
country_options,
{ label: t(".country") },