Validating length of an attribute

suggest change
class Person < ApplicationRecord
  validates :name, length: { minimum: 2 }
  validates :bio, length: { maximum: 500 }
  validates :password, length: { in: 6..20 }
  validates :registration_number, length: { is: 6 }
end

The possible length constraint options are:

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:


ActiveRecord validations:
*Validating length of an attribute

Table Of Contents
11ActiveRecord validations
55CSV