Skip to content
Open
Show file tree
Hide file tree
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
7 changes: 0 additions & 7 deletions gems/activemodel/6.0/activemodel-generated.rbs
Original file line number Diff line number Diff line change
Expand Up @@ -2381,13 +2381,6 @@ module ActiveModel
# ActiveModel::Translation#human_attribute_name.
def lookup_ancestors: () -> untyped

# Transforms attribute names into a more human format, such as "First name"
# instead of "first_name".
#
# Person.human_attribute_name("first_name") # => "First name"
#
# Specify +options+ with additional translating options.
def human_attribute_name: (untyped attribute, ?::Hash[untyped, untyped] options) -> untyped
end
end

Expand Down
6 changes: 6 additions & 0 deletions gems/activemodel/6.0/activemodel.rbs
Original file line number Diff line number Diff line change
Expand Up @@ -505,3 +505,9 @@ module ActiveModel
end
end
end

module ActiveModel
module Translation
def human_attribute_name: (String | Symbol attribute, ?::Hash[Symbol, untyped] options) -> String
end
end
4 changes: 4 additions & 0 deletions gems/activemodel/7.1/_test/test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,7 @@ class Person
error.full_message
error.match?(:name)
error.strict_match?(:name, :too_short, count: 5)

Person.human_attribute_name("name")
Person.human_attribute_name(:name)
Person.human_attribute_name("name", default: "Name")
1 change: 1 addition & 0 deletions gems/activemodel/7.1/_test/test.rbs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ class Person
extend ActiveModel::AttributeRegistration::ClassMethods
include ActiveModel::Validations
extend ActiveModel::Validations::ClassMethods
extend ActiveModel::Translation

attr_accessor name: String?
end
8 changes: 0 additions & 8 deletions gems/activemodel/7.1/activemodel-generated.rbs
Original file line number Diff line number Diff line change
Expand Up @@ -2380,14 +2380,6 @@ module ActiveModel
# ActiveModel::Errors#full_messages and
# ActiveModel::Translation#human_attribute_name.
def lookup_ancestors: () -> untyped

# Transforms attribute names into a more human format, such as "First name"
# instead of "first_name".
#
# Person.human_attribute_name("first_name") # => "First name"
#
# Specify +options+ with additional translating options.
def human_attribute_name: (untyped attribute, ?::Hash[untyped, untyped] options) -> untyped
end
end

Expand Down
6 changes: 6 additions & 0 deletions gems/activemodel/7.1/activemodel.rbs
Original file line number Diff line number Diff line change
Expand Up @@ -505,3 +505,9 @@ module ActiveModel
end
end
end

module ActiveModel
module Translation
def human_attribute_name: (String | Symbol attribute, ?::Hash[Symbol, untyped] options) -> String
end
end
Loading