diff options
author | Douwe Maan <douwe@selenight.nl> | 2017-04-06 10:05:57 -0500 |
---|---|---|
committer | Douwe Maan <douwe@selenight.nl> | 2017-04-06 10:51:45 -0500 |
commit | cc656a11992483911cefe035d579096581cfde57 (patch) | |
tree | 5af4a41d9ae36b3900fdfa0b312b125995c8818c /app/models/note.rb | |
parent | 64c1735c22871d94e0bda8b9f5aece2a29739236 (diff) | |
download | gitlab-ce-cc656a11992483911cefe035d579096581cfde57.tar.gz |
Refactor resolvability checks based on type
Diffstat (limited to 'app/models/note.rb')
-rw-r--r-- | app/models/note.rb | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/app/models/note.rb b/app/models/note.rb index cd4996bdbae..401e3d7bcbc 100644 --- a/app/models/note.rb +++ b/app/models/note.rb @@ -1,3 +1,6 @@ +# A note on the root of an issue, merge request, commit, or snippet. +# +# A note of this type is never resolvable. class Note < ActiveRecord::Base extend ActiveModel::Naming include Gitlab::CurrentSettings @@ -225,11 +228,7 @@ class Note < ActiveRecord::Base end def can_be_discussion_note? - DiscussionNote::NOTEABLE_TYPES.include?(self.noteable_type) && !part_of_discussion? - end - - def can_be_resolvable? - DiscussionNote::RESOLVABLE_TYPES.include?(self.noteable_type) + self.noteable.supports_discussions? && !part_of_discussion? end def discussion_class(noteable = nil) |