aboutsummaryrefslogtreecommitdiffstats
path: root/guides
diff options
context:
space:
mode:
authorRafael Mendonça França <rafaelmfranca@gmail.com>2013-08-04 06:40:04 -0700
committerRafael Mendonça França <rafaelmfranca@gmail.com>2013-08-04 06:40:04 -0700
commitb61666ccf1fdda7eed68fa3febe20c49592fef8e (patch)
treec9e2b70fab33b0bc6098c42ea6082de98482319a /guides
parent72293857c7e757efe1d79b1b51b9d15a4ac99fb6 (diff)
parent740f7787e0b2db6bc476e85774f7a7044e1f983a (diff)
downloadrails-b61666ccf1fdda7eed68fa3febe20c49592fef8e.tar.gz
rails-b61666ccf1fdda7eed68fa3febe20c49592fef8e.tar.bz2
rails-b61666ccf1fdda7eed68fa3febe20c49592fef8e.zip
Merge pull request #11737 from tkhr/fix-document-about-on-validation-helpers
Fix active_record_validations.md document, `:save` for `on:` validation helper was never available
Diffstat (limited to 'guides')
-rw-r--r--guides/source/active_record_validations.md5
1 files changed, 2 insertions, 3 deletions
diff --git a/guides/source/active_record_validations.md b/guides/source/active_record_validations.md
index d95b587e78..8154d4e1cc 100644
--- a/guides/source/active_record_validations.md
+++ b/guides/source/active_record_validations.md
@@ -243,7 +243,7 @@ line of code you can add the same kind of validation to several attributes.
All of them accept the `:on` and `:message` options, which define when the
validation should be run and what message should be added to the `errors`
collection if it fails, respectively. The `:on` option takes one of the values
-`:save` (the default), `:create` or `:update`. There is a default error
+`:create` or `:update`. There is a default error
message for each one of the validation helpers. These messages are used when
the `:message` option isn't specified. Let's take a look at each one of the
available helpers.
@@ -765,10 +765,9 @@ class Person < ActiveRecord::Base
validates :age, numericality: true, on: :update
# the default (validates on both create and update)
- validates :name, presence: true, on: :save
+ validates :name, presence: true
end
```
-The last line is in review state and as of now, it is not running in any version of Rails 3.2.x as discussed in this [issue](https://github.com/rails/rails/issues/10248)
Strict Validations
------------------