Added validation for name: Should not include a http(s) url (#2114)

This commit is contained in:
Henning
2020-09-22 16:46:17 +02:00
committed by GitHub
parent 816cefe1b6
commit 75b989240a
2 changed files with 3 additions and 1 deletions

View File

@ -35,7 +35,8 @@ class User < ApplicationRecord
belongs_to :role, required: false
validates :name, length: { maximum: 256 }, presence: true
validates :name, length: { maximum: 256 }, presence: true,
format: { without: %r{https?://}i }
validates :provider, presence: true
validate :check_if_email_can_be_blank
validates :email, length: { maximum: 256 }, allow_blank: true,