diff options
author | yuuji.yaginuma <yuuji.yaginuma@gmail.com> | 2015-11-07 22:28:17 +0900 |
---|---|---|
committer | yuuji.yaginuma <yuuji.yaginuma@gmail.com> | 2015-11-07 22:31:37 +0900 |
commit | 7b679affe0e78107888b48e42c65060df6821fe2 (patch) | |
tree | 1f048469c6c65e30729b76fc215014ff4135282a /guides/source | |
parent | af3ac5022ec252e45c14f460875edadfb7a64d38 (diff) | |
download | rails-7b679affe0e78107888b48e42c65060df6821fe2.tar.gz rails-7b679affe0e78107888b48e42c65060df6821fe2.tar.bz2 rails-7b679affe0e78107888b48e42c65060df6821fe2.zip |
remove deprecated `:tokenizer` option from guide [ci skip]
`:tokenizer` option was deprecated in 1c341eb7cbaeb52435f14c2595e391bfb2e5e38b
Diffstat (limited to 'guides/source')
-rw-r--r-- | guides/source/active_record_validations.md | 15 |
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 |