Account namespace updates: part 4 (transfers, singular namespacing) #896
Reference in New Issue
Block a user
Delete Branch "zachgoll/account-namespace-updates-part-4"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
See #892 for a detailed proposal of these changes. I will be opening several PRs to achieve the final state so there is a more readable history of the changes.
Part 4 addresses the following:
Namespacing convention
Previously, we had all of our namespaces in the plural form, which presented a few challenges with automatic path and partial resolutions and forced us to maintain a slightly hard-to-read routes file.
To explain the issue, we can look at
Account::Transferas an example:By default, Rails does not automatically "pluralize" the namespaced prefix,
Account::. With our prior setup, we had the Transfer partial sitting at/accounts/transfers/_transfer.html.erb.This made it so the following line would never resolve by "convention":
In an effort to make this codebase as predictable as possible for new contributors, I've updated all of these namespaces to match the singular form and use the following convention (using the namespaced
Account::Transfermodel as example):Routes
Controllers, Views, Locales
AccountsControllerAccount::TransfersControllerAccountAccount::Transfer