File: //usr/local/rvm/gems/ruby-2.7.4/doc/activemodel-6.1.4.1/ri/ActiveModel/Errors/each-i.ri
U:RDoc::AnyMethod[iI" each:ETI"ActiveModel::Errors#each;TF:publico:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I"(Iterates through each error object.;To:RDoc::Markup::BlankLine o:RDoc::Markup::Verbatim; [
I"4person.errors.add(:name, :too_short, count: 2)
;TI"#person.errors.each do |error|
;TI"I # Will yield <#ActiveModel::Error attribute=name, type=too_short,
;TI"> options={:count=>3}>
;TI" end
;T:@format0o;
; [
I"HTo be backward compatible with past deprecated hash-like behavior, ;TI":when block accepts two parameters instead of one, it ;TI"Miterates through each error key, value pair in the error messages hash. ;TI"MYields the attribute and the error for that attribute. If the attribute ;TI"Ihas more than one error message, yields once for each error message.;T@o;; [I"Aperson.errors.add(:name, :blank, message: "can't be blank")
;TI"0person.errors.each do |attribute, message|
;TI"/ # Will yield :name and "can't be blank"
;TI" end
;TI"
;TI"Lperson.errors.add(:name, :not_specified, message: "must be specified")
;TI"0person.errors.each do |attribute, message|
;TI"/ # Will yield :name and "can't be blank"
;TI"2 # then yield :name and "must be specified"
;TI"end;T;
0:
@fileI"lib/active_model/errors.rb;T:0@omit_headings_from_table_of_contents_below00I"attribute, message;T[ I"
(&block);T@)FI"Errors;TcRDoc::NormalClass00