debian-mirror-gitlab/app/models/project_tracing_setting.rb
2021-01-30 21:13:32 +05:30

15 lines
349 B
Ruby

# frozen_string_literal: true
class ProjectTracingSetting < ApplicationRecord
belongs_to :project
validates :external_url, length: { maximum: 255 }, public_url: true
before_validation :sanitize_external_url
private
def sanitize_external_url
self.external_url = Rails::Html::FullSanitizer.new.sanitize(self.external_url)
end
end