diff options
author | Douwe Maan <douwe@selenight.nl> | 2017-03-17 22:25:52 +0300 |
---|---|---|
committer | Luke "Jared" Bennett <lbennett@gitlab.com> | 2017-04-05 19:44:14 +0300 |
commit | 79889a6aa3dc878d196d0f2f445ab6b10ef10c74 (patch) | |
tree | 25367a69b4a529335e106d0d65c2d9a38e97f092 /app/models/diff_note.rb | |
parent | 80b2e18fb62b8da7410f90b3e5340b9e63e765a3 (diff) |
Add specs
Diffstat (limited to 'app/models/diff_note.rb')
-rw-r--r-- | app/models/diff_note.rb | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/app/models/diff_note.rb b/app/models/diff_note.rb index e5f437f8647..d24491b44e7 100644 --- a/app/models/diff_note.rb +++ b/app/models/diff_note.rb @@ -1,6 +1,8 @@ class DiffNote < Note include NoteOnDiff + NOTEABLE_TYPES = %w(MergeRequest Commit).freeze + serialize :original_position, Gitlab::Diff::Position serialize :position, Gitlab::Diff::Position @@ -8,7 +10,7 @@ class DiffNote < Note validates :position, presence: true validates :diff_line, presence: true validates :line_code, presence: true, line_code: true - validates :noteable_type, inclusion: { in: %w(Commit MergeRequest) } + validates :noteable_type, inclusion: { in: NOTEABLE_TYPES } validate :positions_complete validate :verify_supported |