Skip to content

Commit a0bb1dd

Browse files
committed
revises rdoc of AMo::Error#add [rails#4738 state:resolved]
1 parent 0cc4cd0 commit a0bb1dd

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

activemodel/lib/active_model/errors.rb

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -170,13 +170,13 @@ def to_xml(options={})
170170
end
171171
end
172172

173-
# Adds an error message (+messsage+) to the +attribute+, which will be returned on a call to <tt>on(attribute)</tt>
174-
# for the same attribute and ensure that this error object returns false when asked if <tt>empty?</tt>. More than one
175-
# error can be added to the same +attribute+ in which case an array will be returned on a call to <tt>on(attribute)</tt>.
176-
# If no +messsage+ is supplied, :invalid is assumed.
173+
# Adds +message+ to the error messages on +attribute+, which will be returned on a call to
174+
# <tt>on(attribute)</tt> for the same attribute. More than one error can be added to the same
175+
# +attribute+ in which case an array will be returned on a call to <tt>on(attribute)</tt>.
176+
# If no +message+ is supplied, <tt>:invalid</tt> is assumed.
177177
#
178-
# If +message+ is a Symbol, it will be translated, using the appropriate scope (see translate_error).
179-
# If +message+ is a Proc, it will be called, allowing for things like Time.now to be used within an error
178+
# If +message+ is a symbol, it will be translated using the appropriate scope (see +translate_error+).
179+
# If +message+ is a proc, it will be called, allowing for things like <tt>Time.now</tt> to be used within an error.
180180
def add(attribute, message = nil, options = {})
181181
message ||= :invalid
182182
message = generate_message(attribute, message, options) if message.is_a?(Symbol)

0 commit comments

Comments
 (0)