Class: SystemNoteMetadata

Inherits:
ApplicationRecord show all
Includes:
IgnorableColumns, Importable
Defined in:
app/models/system_note_metadata.rb

Constant Summary collapse

TYPES_WITH_CROSS_REFERENCES =

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)

%w[
  commit cross_reference
  closed duplicate
  moved merge
  label milestone
  relate unrelate
  cloned
].freeze
ICON_TYPES =
%w[
  commit description merge confidential visible label assignee cross_reference
  designs_added designs_modified designs_removed designs_discussion_added
  title time_tracking branch milestone discussion task moved cloned
  opened closed merged duplicate locked unlocked outdated reviewer
  tag due_date start_date_or_due_date pinned_embed cherry_pick health_status approved unapproved
  status alert_issue_added relate unrelate new_alert_added severity contact timeline_event
  issue_type relate_to_child unrelate_from_child relate_to_parent unrelate_from_parent
].freeze

Constants inherited from ApplicationRecord

ApplicationRecord::MAX_PLUCK

Constants included from ResetOnUnionError

ResetOnUnionError::MAX_RESET_PERIOD

Instance Attribute Summary

Attributes included from Importable

#imported, #importing

Instance Method Summary collapse

Methods inherited from ApplicationRecord

cached_column_list, #create_or_load_association, declarative_enum, default_select_columns, id_in, id_not_in, iid_in, pluck_primary_key, primary_key_in, #readable_by?, safe_ensure_unique, safe_find_or_create_by, safe_find_or_create_by!, #to_ability_name, underscore, where_exists, where_not_exists, with_fast_read_statement_timeout, without_order

Methods included from SensitiveSerializableHash

#serializable_hash

Instance Method Details

#cross_reference_typesObject



49
50
51
# File 'app/models/system_note_metadata.rb', line 49

def cross_reference_types
  TYPES_WITH_CROSS_REFERENCES
end

#declarative_policy_delegateObject



41
42
43
# File 'app/models/system_note_metadata.rb', line 41

def declarative_policy_delegate
  note
end

#icon_typesObject



45
46
47
# File 'app/models/system_note_metadata.rb', line 45

def icon_types
  ICON_TYPES
end