More CSS simplification

Edit domain names, updates credentials and virtuals
Model domain tests for length and valid characters
This commit is contained in:
2024-05-20 12:41:45 +01:00
parent 781b2bb9f0
commit dcd4efdd4e
7 changed files with 50 additions and 5 deletions

View File

@@ -5,6 +5,7 @@ class Domain < ApplicationRecord
has_many :virtuals, dependent: :destroy
validates :domain, presence: true
validates :domain, uniqueness: true
validates :domain, format: { with: /\A(((?!-))(xn--|_)?[a-z0-9-]{0,61}[a-z0-9]{1,1}\.)*(xn--)?([a-z0-9][a-z0-9\-]{0,60}|[a-z0-9-]{1,30}\.[a-z]{2,})\z/, message: "domain not valid" }
private
def create_abuse_postmaster