Method: ActiveRecord::Validations::ClassMethods#validates_length_of

Defined in:
lib/active_record/validations/length.rb

#validates_length_of(*attr_names) ⇒ Object Also known as: validates_size_of

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.



19
20
21
# File 'lib/active_record/validations/length.rb', line 19

def validates_length_of(*attr_names)
  validates_with LengthValidator, _merge_attributes(attr_names)
end