instance method
validates_length_of
Ruby on Rails 8.1.2
Since v2.2.3Signature
validates_length_of(*attr_names)
Validates that the specified attributes match the length restrictions supplied. If the attribute is an association, records that are marked for destruction are not counted.
See ActiveModel::Validations::HelperMethods.validates_length_of for more information.
Parameters
-
attr_namesrest
Source
# File activerecord/lib/active_record/validations/length.rb, line 19
def validates_length_of(*attr_names)
validates_with LengthValidator, _merge_attributes(attr_names)
end
Defined in activerecord/lib/active_record/validations/length.rb line 19
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveRecord::Validations::ClassMethods