Permalink
Browse files

revises rdoc of AMo::Error#add [#4738 state:resolved]

  • Loading branch information...
1 parent 52f9057 commit 7edc6b00daf59c840f140dcb855f2a1d34661c58 @fxn fxn committed with mikel Jun 1, 2010
Showing with 6 additions and 6 deletions.
  1. +6 −6 activemodel/lib/active_model/errors.rb
View
12 activemodel/lib/active_model/errors.rb
@@ -170,13 +170,13 @@ def to_xml(options={})
end
end
- # Adds an error message (+messsage+) to the +attribute+, which will be returned on a call to <tt>on(attribute)</tt>
- # for the same attribute and ensure that this error object returns false when asked if <tt>empty?</tt>. More than one
- # error can be added to the same +attribute+ in which case an array will be returned on a call to <tt>on(attribute)</tt>.
- # If no +messsage+ is supplied, :invalid is assumed.
+ # Adds +message+ to the error messages on +attribute+, which will be returned on a call to
+ # <tt>on(attribute)</tt> for the same attribute. More than one error can be added to the same
+ # +attribute+ in which case an array will be returned on a call to <tt>on(attribute)</tt>.
+ # If no +message+ is supplied, <tt>:invalid</tt> is assumed.
#
- # If +message+ is a Symbol, it will be translated, using the appropriate scope (see translate_error).
- # If +message+ is a Proc, it will be called, allowing for things like Time.now to be used within an error
+ # If +message+ is a symbol, it will be translated using the appropriate scope (see +translate_error+).
+ # If +message+ is a proc, it will be called, allowing for things like <tt>Time.now</tt> to be used within an error.
def add(attribute, message = nil, options = {})
message ||= :invalid
message = generate_message(attribute, message, options) if message.is_a?(Symbol)

0 comments on commit 7edc6b0

Please sign in to comment.