summaryrefslogtreecommitdiff
path: root/app/models/project_tracing_setting.rb
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