Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
18 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
--- | ||
title: ActiveModel::Validations::Length | ||
--- | ||
|
||
``` | ||
$ ruby -v | ||
ruby 2.1.4p265 (2014-10-27 revision 48166) [x86_64-darwin14.0] | ||
``` | ||
|
||
``` | ||
$ bundle exec ruby -r rails -e 'puts Rails.version' | ||
4.2.0 | ||
``` | ||
|
||
* [ソースコード](https://github.com/rails/rails/blob/v4.2.0/activemodel/lib/active_model/validations/length.rb) | ||
|
||
値の長さに関するバリデータ。:minimumや:maximumを使って指定することもできるが、:inをつかってRangeによる指定も可能。 | ||
:tokenizerを指定することで対象の値を分割することもできる。 |