aboutsummaryrefslogtreecommitdiffstats
path: root/railties
diff options
context:
space:
mode:
authorNeeraj Singh <neerajdotname@gmail.com>2010-11-20 21:01:15 -0500
committerNeeraj Singh <neerajdotname@gmail.com>2010-11-20 21:01:15 -0500
commit7b503f02ca2a8ac46e17e447b92d4a68fcc4a356 (patch)
tree935068945b52b650aebdecb75496d5fbd1fa89a3 /railties
parent69d47a00c7e43e2431aa1b164a2e6309da1bf118 (diff)
parent074782eda2caddb054d20a99e8d167ef8e1eecd2 (diff)
downloadrails-7b503f02ca2a8ac46e17e447b92d4a68fcc4a356.tar.gz
rails-7b503f02ca2a8ac46e17e447b92d4a68fcc4a356.tar.bz2
rails-7b503f02ca2a8ac46e17e447b92d4a68fcc4a356.zip
Merge branch 'master' of github.com:lifo/docrails
Diffstat (limited to 'railties')
-rw-r--r--railties/guides/source/active_record_validations_callbacks.textile2
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 444a1d4154..9ddbe6fadc 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]+ that returns an array with all attribute errors, when 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.