Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # validates
- validates :name,
- presence: true,
- uniqueness: true,
- length: { maximum: 32 },
- format: { with: /\A[a-z|0-9|_]+\z/ } # 半角アルファベット, 数値, アンスコのみ
- validates :postal_code,
- format: { with: /\A\d{7}\z/ },
- allow_blank: true
- validates :address,
- length: { maximum: 255 },
- allow_blank: true
- validates :tel,
- length: { maximum: 13 },
- format: { with: /\A\d{2,}+-\d{4}+-\d{4}+\z/ },
- allow_blank: true
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement