@@ -287,7 +287,7 @@ def group_by_attribute
287
287
# person.errors.messages
288
288
# # => {:name=>["can't be blank"]}
289
289
#
290
- # person.errors.add(:name, :too_long, { count: 25 } )
290
+ # person.errors.add(:name, :too_long, count: 25)
291
291
# person.errors.messages
292
292
# # => ["is too long (maximum is 25 characters)"]
293
293
#
@@ -338,7 +338,7 @@ def add(attribute, type = :invalid, **options)
338
338
# If the error requires options, then it returns +true+ with
339
339
# the correct options, or +false+ with incorrect or missing options.
340
340
#
341
- # person.errors.add :name, :too_long, { count: 25 }
341
+ # person.errors.add :name, :too_long, count: 25
342
342
# person.errors.added? :name, :too_long, count: 25 # => true
343
343
# person.errors.added? :name, "is too long (maximum is 25 characters)" # => true
344
344
# person.errors.added? :name, :too_long, count: 24 # => false
@@ -360,7 +360,7 @@ def added?(attribute, type = :invalid, options = {})
360
360
# present, or +false+ otherwise. +type+ is treated the same as for +add+.
361
361
#
362
362
# person.errors.add :age
363
- # person.errors.add :name, :too_long, { count: 25 }
363
+ # person.errors.add :name, :too_long, count: 25
364
364
# person.errors.of_kind? :age # => true
365
365
# person.errors.of_kind? :name # => false
366
366
# person.errors.of_kind? :name, :too_long # => true
0 commit comments