Skip to content
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

Pre-zeitwerk - Add inflections and acronyms #22620

Merged
merged 1 commit into from
Jul 14, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions lib/vmdb/inflections.rb
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,24 @@ def self.load_core_inflections
inflect.plural(/quota$/, "quotas")
inflect.irregular("container_quota", "container_quotas")

inflect.acronym('DBus')
inflect.acronym('DDF')
inflect.acronym('GHT')
inflect.acronym('IPMI')
inflect.acronym('ManageIQ')
inflect.acronym('MKS')
inflect.acronym('OAuth')
inflect.acronym('REXML')
inflect.acronym('SAP')
inflect.acronym('SSL')
inflect.acronym('UI')
end

# ActiveSupport::Inflector.inflections doesn't allow us to blanket tell how to autoload a constant from a file
# This works around the UI acronym above.
Rails.autoloaders.each do |autoloader|
autoloader.inflector.inflect('miq_ui_worker' => "MiqUiWorker")
autoloader.inflector.inflect('vpc' => "VPC")
end
end

Expand Down