class ActiveModel::Errors
def messages_for(attribute)
Experimental RBS support (using type sampling data from the type_fusion
project).
def messages_for: (String attribute) -> untyped
This signature was generated using 1 sample from 1 application.
person.errors.messages_for(:name)
person = Person.create()
end
validates_length_of :name, in: 5..30
validates_presence_of :name, :email
class Person
Returns all the error messages for a given attribute in an array.
def messages_for(attribute) where(attribute).map(&:message) end