mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Merge pull request #42839 from jonathanhefner/doc-each_validator
Remove nodoc from EachValidator [ci-skip]
This commit is contained in:
commit
baa070c3b4
2 changed files with 3 additions and 2 deletions
|
@ -129,7 +129,7 @@ module ActiveModel
|
||||||
# record, attribute and value.
|
# record, attribute and value.
|
||||||
#
|
#
|
||||||
# All \Active \Model validations are built on top of this validator.
|
# All \Active \Model validations are built on top of this validator.
|
||||||
class EachValidator < Validator #:nodoc:
|
class EachValidator < Validator
|
||||||
attr_reader :attributes
|
attr_reader :attributes
|
||||||
|
|
||||||
# Returns a new validator instance. All options will be available via the
|
# Returns a new validator instance. All options will be available via the
|
||||||
|
|
|
@ -1087,7 +1087,7 @@ end
|
||||||
```
|
```
|
||||||
|
|
||||||
The easiest way to add custom validators for validating individual attributes
|
The easiest way to add custom validators for validating individual attributes
|
||||||
is with the convenient `ActiveModel::EachValidator`. In this case, the custom
|
is with the convenient [`ActiveModel::EachValidator`][]. In this case, the custom
|
||||||
validator class must implement a `validate_each` method which takes three
|
validator class must implement a `validate_each` method which takes three
|
||||||
arguments: record, attribute, and value. These correspond to the instance, the
|
arguments: record, attribute, and value. These correspond to the instance, the
|
||||||
attribute to be validated, and the value of the attribute in the passed
|
attribute to be validated, and the value of the attribute in the passed
|
||||||
|
@ -1110,6 +1110,7 @@ end
|
||||||
As shown in the example, you can also combine standard validations with your
|
As shown in the example, you can also combine standard validations with your
|
||||||
own custom validators.
|
own custom validators.
|
||||||
|
|
||||||
|
[`ActiveModel::EachValidator`]: https://api.rubyonrails.org/classes/ActiveModel/EachValidator.html
|
||||||
[`ActiveModel::Validator`]: https://api.rubyonrails.org/classes/ActiveModel/Validator.html
|
[`ActiveModel::Validator`]: https://api.rubyonrails.org/classes/ActiveModel/Validator.html
|
||||||
|
|
||||||
### Custom Methods
|
### Custom Methods
|
||||||
|
|
Loading…
Reference in a new issue