system_note_metadata.rb 784 Bytes
Newer Older
1
class SystemNoteMetadata < ActiveRecord::Base
2
3
4
5
6
7
8
9
  # These notes's action text might contain a reference that is external.
  # We should always force a deep validation upon references that are found
  # in this note type.
  # Other notes can always be safely shown as all its references are
  # in the same project (i.e. with the same permissions)
  TYPES_WITH_CROSS_REFERENCES = %w[
    cross_reference
    milestone
micael.bergeron's avatar
micael.bergeron committed
10
  ].freeze
11

12
  ICON_TYPES = %w[
13
    commit description merge confidential visible label assignee cross_reference
Ryan Scott's avatar
Ryan Scott committed
14
    title time_tracking branch milestone discussion task moved
15
    opened closed merged duplicate locked unlocked
Ryan Scott's avatar
Ryan Scott committed
16
    outdated
17
18
19
  ].freeze

  validates :note, presence: true
20
  validates :action, inclusion: ICON_TYPES, allow_nil: true
21
22
23

  belongs_to :note
end