refactor: simplify localized_name method
Some checks failed
Docker Dev / docker (push) Has been cancelled
CI / scan_ruby (push) Has been cancelled
CI / lint (push) Has been cancelled
CI / test (push) Has been cancelled
Docker Main / docker (push) Has been cancelled

- Remove I18n translation from localized_name
- Return city name directly instead

This change simplifies the method's implementation by returning
the city name directly, avoiding the overhead of translation.
Additionally, it improves code clarity by reducing complexity.
This commit is contained in:
songtianlun 2025-04-12 16:54:00 +08:00
parent 6dce657126
commit cb8e5dd57d

View File

@ -152,7 +152,8 @@ class City < ApplicationRecord
end
def localized_name
I18n.t("cities.#{name.parameterize.underscore}", default: name)
# I18n.t("cities.#{name.parameterize.underscore}", default: name)
name
end
def full_name