diff options
author | Bob Van Landuyt <bob@vanlanduyt.co> | 2019-06-03 16:41:05 +0200 |
---|---|---|
committer | Bob Van Landuyt <bob@vanlanduyt.co> | 2019-06-03 16:41:05 +0200 |
commit | 4504959aa6ce6667b9fd5b68ff24a612cb7c027b (patch) | |
tree | be88c9ff22e0ec8ac6af5c31bca7e4f2f318c62c /app/models/concerns/noteable.rb | |
parent | 2ad5b30b6c02a3e3f84275121a709f5de75dac48 (diff) | |
download | gitlab-ce-4504959aa6ce6667b9fd5b68ff24a612cb7c027b.tar.gz |
Make `resolvable_types` a class method
This turns Notable::RESOLVABLE_TYPES into a
`Notable.resolvable_types`. That allows us to override it in EE.
Diffstat (limited to 'app/models/concerns/noteable.rb')
-rw-r--r-- | app/models/concerns/noteable.rb | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/app/models/concerns/noteable.rb b/app/models/concerns/noteable.rb index bfd0c36942b..4b428b0af83 100644 --- a/app/models/concerns/noteable.rb +++ b/app/models/concerns/noteable.rb @@ -3,14 +3,16 @@ module Noteable extend ActiveSupport::Concern - # `Noteable` class names that support resolvable notes. - RESOLVABLE_TYPES = %w(MergeRequest).freeze - class_methods do # `Noteable` class names that support replying to individual notes. def replyable_types %w(Issue MergeRequest) end + + # `Noteable` class names that support resolvable notes. + def resolvable_types + %w(MergeRequest) + end end # The timestamp of the note (e.g. the :created_at or :updated_at attribute if provided via @@ -36,7 +38,7 @@ module Noteable end def supports_resolvable_notes? - RESOLVABLE_TYPES.include?(base_class_name) + self.class.resolvable_types.include?(base_class_name) end def supports_discussions? @@ -131,3 +133,5 @@ module Noteable ) end end + +Noteable.extend(Noteable::ClassMethods) |