654c4dd922
This replaces API::Notes::NOTEABLE_TYPES and API::Discussions::NOTEABLE_TYPES with class methods defined in a separate helper modules. This allows EE to extend the list of noteable types, without having to modify the constant in-place. We can't define these methods directly in the API classes, as they would be used before we're able to extend them in EE.
13 lines
292 B
Ruby
13 lines
292 B
Ruby
# frozen_string_literal: true
|
|
|
|
module API
|
|
module Helpers
|
|
module DiscussionsHelpers
|
|
def self.noteable_types
|
|
# This is a method instead of a constant, allowing EE to more easily
|
|
# extend it.
|
|
[Issue, Snippet, MergeRequest, Commit]
|
|
end
|
|
end
|
|
end
|
|
end
|