diff options
author | Clement Ho <clemmakesapps@gmail.com> | 2018-11-01 15:20:54 +0000 |
---|---|---|
committer | Clement Ho <clemmakesapps@gmail.com> | 2018-11-01 15:20:54 +0000 |
commit | 3c99d8308a481b3f6edb002912ffc4d760b7fb64 (patch) | |
tree | 73555ed44c63103ae57836dd00587e45d084dff2 /app/models/diff_note.rb | |
parent | 0336dc438b6faab575df996364076b57e388cc27 (diff) | |
parent | d3a407d66fa553f3ff8afd1b9e42f01b9912e14a (diff) | |
download | gitlab-ce-gl-ui-progress-bar.tar.gz |
Merge branch 'master' into 'gl-ui-progress-bar'gl-ui-progress-bar
# Conflicts:
# app/assets/javascripts/commons/gitlab_ui.js
Diffstat (limited to 'app/models/diff_note.rb')
-rw-r--r-- | app/models/diff_note.rb | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/app/models/diff_note.rb b/app/models/diff_note.rb index 95694377fe3..5f59e4832db 100644 --- a/app/models/diff_note.rb +++ b/app/models/diff_note.rb @@ -8,12 +8,14 @@ class DiffNote < Note include DiffPositionableNote include Gitlab::Utils::StrongMemoize - NOTEABLE_TYPES = %w(MergeRequest Commit).freeze + def self.noteable_types + %w(MergeRequest Commit) + end validates :original_position, presence: true validates :position, presence: true validates :line_code, presence: true, line_code: true, if: :on_text? - validates :noteable_type, inclusion: { in: NOTEABLE_TYPES } + validates :noteable_type, inclusion: { in: noteable_types } validate :positions_complete validate :verify_supported validate :diff_refs_match_commit, if: :for_commit? |