# frozen_string_literal: true module Phccodesnipper module Script class Url < ApplicationRecord # Include Core Validations phc_domain_regx = URI::DEFAULT_PARSER.make_regexp(%w[http https]) # Relationships belongs_to :snippet, class_name: 'Phccodesnipper::Script::Snippet' # Form Fields Validation validates :script_url, presence: true, format: { with: phc_domain_regx, message: 'Please follow this URL format http or https://www.**********.com' } end end end