diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-09-20 02:18:09 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-09-20 02:18:09 +0300 |
commit | 6ed4ec3e0b1340f96b7c043ef51d1b33bbe85fde (patch) | |
tree | dc4d20fe6064752c0bd323187252c77e0a89144b /app/models/note.rb | |
parent | 9868dae7fc0655bd7ce4a6887d4e6d487690eeed (diff) |
Add latest changes from gitlab-org/gitlab@15-4-stable-eev15.4.0-rc42
Diffstat (limited to 'app/models/note.rb')
-rw-r--r-- | app/models/note.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/app/models/note.rb b/app/models/note.rb index 1715f7cdc3b..daac489757b 100644 --- a/app/models/note.rb +++ b/app/models/note.rb @@ -164,6 +164,9 @@ class Note < ApplicationRecord scope :like_note_or_capitalized_note, ->(text) { where('(note LIKE ? OR note LIKE ?)', text, text.capitalize) } before_validation :nullify_blank_type, :nullify_blank_line_code + # Syncs `confidential` with `internal` as we rename the column. + # https://gitlab.com/gitlab-org/gitlab/-/issues/367923 + before_create :set_internal_flag after_save :keep_around_commit, if: :for_project_noteable?, unless: -> { importing? || skip_keep_around_commits } after_save :expire_etag_cache, unless: :importing? after_save :touch_noteable, unless: :importing? @@ -813,6 +816,10 @@ class Note < ApplicationRecord def noteable_can_have_confidential_note? for_issue? end + + def set_internal_flag + self.internal = confidential if confidential + end end Note.prepend_mod_with('Note') |