Skip to content

Add custom inflections for acronyms used in model names #37

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
postmodern opened this issue Mar 17, 2023 · 1 comment
Open

Add custom inflections for acronyms used in model names #37

postmodern opened this issue Mar 17, 2023 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@postmodern
Copy link
Member

postmodern commented Mar 17, 2023

Since certain model names contain acronyms, we must configure ActiveSupport::Inflector to preserve them as acronyms instead of converting them to CamelCase when converting the model name into a human readable name:

  • Wrong: IPAddress.model_name.human # => "Ip address"
  • Correct: IPAddress.model_name.human # => "IP address"
@postmodern postmodern added the feature New Feature label Mar 17, 2023
@postmodern postmodern self-assigned this Mar 17, 2023
@postmodern postmodern added this to the 0.2.0 milestone Mar 17, 2023
@postmodern postmodern changed the title Add an i18n locale.yml file Add custom inflections for acronyms used in model names Mar 17, 2023
@postmodern postmodern added enhancement New feature or request and removed feature New Feature labels Mar 17, 2023
@postmodern postmodern transferred this issue from ronin-rb/ronin-db-activerecord Apr 4, 2023
@postmodern postmodern added the CLI label Apr 4, 2023
@postmodern postmodern transferred this issue from ronin-rb/ronin-db Apr 5, 2023
@postmodern postmodern removed the CLI label Apr 5, 2023
@postmodern
Copy link
Member Author

This will require renaming some of the migration classes as well CreateRoninIpAddressesTable -> CreateRoninIPAddressesTable.

@postmodern postmodern removed this from the 0.2.0 milestone Aug 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant