Add ActiveModel::Translation human_attribute_name type#1007
Add ActiveModel::Translation human_attribute_name type#1007babashunya wants to merge 1 commit intoruby:mainfrom
Conversation
32f8129 to
4e3d760
Compare
## Overview The `human_attribute_name` method in `ActiveModel::Translation` had `untyped` for both arguments and return value. Since the implementation always returns `String` (either from `I18n.translate` or `.humanize` fallback), and the first argument accepts `String` or `Symbol` (`.to_s` is called internally), the type has been updated to be more specific. ## References - human_attribute_name - https://api.rubyonrails.org/classes/ActiveModel/Translation.html#method-i-human_attribute_name - https://github.com/rails/rails/blob/main/activemodel/lib/active_model/translation.rb
4e3d760 to
155ec9f
Compare
|
@babashunya Thanks for your contribution! Please follow the instructions below for each change. Available commandsYou can use the following commands by commenting on this PR.
|
|
@babashunya Thank you for your request. |
|
@ksss |

Overview
The
human_attribute_namemethod inActiveModel::Translationhaduntypedfor both arguments and return value.Since the implementation always returns
String(either fromI18n.translateor.humanizefallback), and the first argument acceptsStringorSymbol(.to_sis called internally), the type has been updated to be more specific.References