Class: ActiveRecord::Validations::LengthValidator
Do not use. This class is for internal use only.
Relationships & Source Files | |
Super Chains via Extension / Inclusion / Inheritance | |
Class Chain:
|
|
Instance Chain:
|
|
Inherits: |
ActiveModel::Validations::LengthValidator
|
Defined in: | activerecord/lib/active_record/validations/length.rb |
Constant Summary
Class Method Summary
::ActiveModel::Validations::LengthValidator
- Inherited
::ActiveModel::EachValidator
- Inherited
.new | Returns a new validator instance. |
::ActiveModel::Validator
- Inherited
Instance Attribute Summary
Instance Method Summary
::ActiveModel::Validations::LengthValidator
- Inherited
::ActiveModel::Validations::ResolveValue
- Included
::ActiveModel::EachValidator
- Inherited
#check_validity! | Hook method that gets called by the initializer allowing verification that the arguments supplied are valid. |
#validate | Performs validation on the supplied record. |
#validate_each | Override this method in subclasses with the validation logic, adding errors to the records |
#prepare_value_for_validation |
::ActiveModel::Validator
- Inherited
Constructor Details
This class inherits a constructor from ActiveModel::Validations::LengthValidator
Instance Method Details
#validate_each(record, attribute, association_or_value)
[ GitHub ]# File 'activerecord/lib/active_record/validations/length.rb', line 6
def validate_each(record, attribute, association_or_value) if association_or_value.respond_to?(:loaded?) && association_or_value.loaded? association_or_value = association_or_value.target.reject(&:marked_for_destruction?) end super end