app/models/phccodesnipper/script/url.rb in phccodesnipper-6.1.0 vs app/models/phccodesnipper/script/url.rb in phccodesnipper-6.1.1
- old
+ new
@@ -1,16 +1,18 @@
+# frozen_string_literal: true
+
module Phccodesnipper
- class Script::Url < ApplicationRecord
+ module Script
+ class Url < ApplicationRecord
+ # Include Core Validations
+ phc_domain_regx = URI::DEFAULT_PARSER.make_regexp(%w[http https])
- # Include Core Validations
- phc_domain_regx = URI::regexp(%w(http https))
+ # Relationships
+ belongs_to :snippet, class_name: 'Phccodesnipper::Script::Snippet'
- # 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" }
-
+ # 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