diff options
author | Xavier Noria <fxn@hashref.com> | 2010-11-21 00:01:10 +0100 |
---|---|---|
committer | Xavier Noria <fxn@hashref.com> | 2010-11-21 03:29:44 +0100 |
commit | a03a3b7c3130a93ca6385a1f89ce553d00ca3c49 (patch) | |
tree | 14467c6bf5e6eccedcd579d4abcea6eb6043797d /railties/guides/source | |
parent | ffed9db2692475a6e24354336f884991075906c5 (diff) | |
download | rails-a03a3b7c3130a93ca6385a1f89ce553d00ca3c49.tar.gz rails-a03a3b7c3130a93ca6385a1f89ce553d00ca3c49.tar.bz2 rails-a03a3b7c3130a93ca6385a1f89ce553d00ca3c49.zip |
copy-edits d773ef8
Diffstat (limited to 'railties/guides/source')
-rw-r--r-- | railties/guides/source/active_record_validations_callbacks.textile | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/railties/guides/source/active_record_validations_callbacks.textile b/railties/guides/source/active_record_validations_callbacks.textile index 940ee93cc1..9ce0423244 100644 --- a/railties/guides/source/active_record_validations_callbacks.textile +++ b/railties/guides/source/active_record_validations_callbacks.textile @@ -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. |