2019-04-26 17:23:26 +00:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
class ProjectMetricsSetting < ApplicationRecord
|
|
|
|
belongs_to :project
|
|
|
|
|
|
|
|
validates :external_dashboard_url,
|
2020-06-10 12:08:58 +00:00
|
|
|
allow_nil: true,
|
2019-04-26 17:23:26 +00:00
|
|
|
length: { maximum: 255 },
|
|
|
|
addressable_url: { enforce_sanitization: true, ascii_only: true }
|
2020-06-09 03:08:27 +00:00
|
|
|
|
|
|
|
enum dashboard_timezone: { local: 0, utc: 1 }
|
2020-06-12 03:08:22 +00:00
|
|
|
|
|
|
|
def dashboard_timezone=(val)
|
|
|
|
super(val&.downcase)
|
|
|
|
end
|
2019-04-26 17:23:26 +00:00
|
|
|
end
|