mirror of https://github.com/rails/rails
Name#model_name doesn't return a String object
This commit is contained in:
parent
4a3f71b6fb
commit
33cc907305
|
@ -147,7 +147,7 @@ behavior out of the box:
|
|||
extend ActiveModel::Naming
|
||||
end
|
||||
|
||||
NamedPerson.model_name # => "NamedPerson"
|
||||
NamedPerson.model_name.name # => "NamedPerson"
|
||||
NamedPerson.model_name.human # => "Named person"
|
||||
|
||||
{Learn more}[link:classes/ActiveModel/Naming.html]
|
||||
|
|
|
@ -204,7 +204,7 @@ module ActiveModel
|
|||
# extend ActiveModel::Naming
|
||||
# end
|
||||
#
|
||||
# BookCover.model_name # => "BookCover"
|
||||
# BookCover.model_name.name # => "BookCover"
|
||||
# BookCover.model_name.human # => "Book cover"
|
||||
#
|
||||
# BookCover.model_name.i18n_key # => :book_cover
|
||||
|
|
Loading…
Reference in New Issue