Skip to content

Commit

Permalink
ActiveModel Validations Length
Browse files Browse the repository at this point in the history
  • Loading branch information
eiel committed Jan 3, 2015
1 parent adf10a4 commit 0d303b0
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions active_model/validations/length.md
@@ -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を指定することで対象の値を分割することもできる。

0 comments on commit 0d303b0

Please sign in to comment.