Welcome to mirror list, hosted at ThFree Co, Russian Federation.

project_tracing_setting.rb « models « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 93fa80aed6756f643e08dbdd208cbd931b51bed3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
# 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