aboutsummaryrefslogtreecommitdiffstats
path: root/guides/source
diff options
context:
space:
mode:
authorRichard Schneeman <richard.schneeman@gmail.com>2015-11-07 08:21:01 -0600
committerRichard Schneeman <richard.schneeman@gmail.com>2015-11-07 08:21:01 -0600
commitd238cb88a33a9fb2b53f63ce28d38a3e1a6a1ead (patch)
treeff875d3a89d0d1b0dc8d0a9491b6bbd9dd6eb2dd /guides/source
parent3894fd913fade3e69b53df74a3a5f78d727aeb69 (diff)
parent7b679affe0e78107888b48e42c65060df6821fe2 (diff)
downloadrails-d238cb88a33a9fb2b53f63ce28d38a3e1a6a1ead.tar.gz
rails-d238cb88a33a9fb2b53f63ce28d38a3e1a6a1ead.tar.bz2
rails-d238cb88a33a9fb2b53f63ce28d38a3e1a6a1ead.zip
Merge pull request #22213 from y-yagi/remove_deprecated_option_from_guide
remove deprecated `:tokenizer` option from guide [ci skip]
Diffstat (limited to 'guides/source')
-rw-r--r--guides/source/active_record_validations.md15
1 files changed, 0 insertions, 15 deletions
diff --git a/guides/source/active_record_validations.md b/guides/source/active_record_validations.md
index dd4d9f55fa..fe42cec158 100644
--- a/guides/source/active_record_validations.md
+++ b/guides/source/active_record_validations.md
@@ -457,21 +457,6 @@ class Person < ActiveRecord::Base
end
```
-This helper counts characters by default, but you can split the value in a
-different way using the `:tokenizer` option:
-
-```ruby
-class Essay < ActiveRecord::Base
- validates :content, length: {
- minimum: 300,
- maximum: 400,
- tokenizer: lambda { |str| str.split(/\s+/) },
- too_short: "must have at least %{count} words",
- too_long: "must have at most %{count} words"
- }
-end
-```
-
Note that the default error messages are plural (e.g., "is too short (minimum
is %{count} characters)"). For this reason, when `:minimum` is 1 you should
provide a personalized message or use `presence: true` instead. When