Skip to content
This repository was archived by the owner on Jul 27, 2025. It is now read-only.

Conversation

zachgoll
Copy link
Collaborator

@zachgoll zachgoll commented Jun 20, 2024

See #892 for a detailed proposal of these changes. I will be opening several PRs to achieve the final state so there is a semi-readable history of the changes.

Part 2 renames Transaction::Category to Category and moves all of the routes, controllers, etc. to the top-level namespace.

This thins out the hierarchy and will make it much easier to deal with categories in the final stage of this namespace update when we start implementing various types of transactions (some of which may not be valid with a category).

Future considerations for Category

While a Category generally applies to a Transaction (hence why it was originally namespaced), we have had several feature requests asking to be able to apply categories to the Account.

By moving to the top-level namespace, we'll be able to use STI (instead of namespacing—lots of duplication) to model out different types of categories:

class Category < ActiveRecord::Base; end
class TransactionCategory < Category; end
class AccountCategory < Category; end

From a field-level perspective, a TransactionCategory and AccountCategory has nearly the same exact attributes (i.e. name, color), making it a good candidate for this type of inheritance. We can then use the type to help delineate the management of these family-defined categories in the UI.

@zachgoll zachgoll merged commit 2681dd9 into main Jun 20, 2024
@zachgoll zachgoll deleted the zachgoll/account-namespace-updates-part-2 branch June 20, 2024 12:15
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant