Skip to content

Commit

Permalink
copy-edits d773ef8
Browse files Browse the repository at this point in the history
  • Loading branch information
fxn committed Nov 20, 2010
1 parent d773ef8 commit 074782e
Showing 1 changed file with 1 addition and 1 deletion.
Expand Up @@ -141,7 +141,7 @@ end

h4(#validations_overview-errors). +errors[]+

To verify whether or not a particular attribute of an object is valid, you can use +errors[:attribute]+. It returns an array of all the errors for +:attribue+. If there are no errors on the specified attribute, an empty array is returned.
To verify whether or not a particular attribute of an object is valid, you can use +errors[:attribute]+. It returns an array of all the errors for +:attribute+. If there are no errors on the specified attribute, an empty array is returned.

This method is only useful _after_ validations have been run, because it only inspects the errors collection and does not trigger validations itself. It's different from the +ActiveRecord::Base#invalid?+ method explained above because it doesn't verify the validity of the object as a whole. It only checks to see whether there are errors found on an individual attribute of the object.

Expand Down

0 comments on commit 074782e

Please sign in to comment.