class ActiveModel::Errors

def where(attribute, type = nil, **options)

Experimental RBS support (using type sampling data from the type_fusion project).

def where: (Symbol attribute, ?nil type, **Hash options) -> untyped

This signature was generated using 1 sample from 1 application.

person.errors.where(:name, :too_short, minimum: 2) # => all name errors being too short and minimum is 2
person.errors.where(:name, :too_short) # => all name errors being too short
person.errors.where(:name) # => all name errors.

Only supplied params will be matched.

Search for errors matching +attribute+, +type+, or +options+.
def where(attribute, type = nil, **options)
  attribute, type, options = normalize_arguments(attribute, type, **options)
  @errors.select { |error|
    error.match?(attribute, type, **options)
  }
end