gitlab-org--gitlab-foss/lib/api/helpers/discussions_helpers.rb
Yorick Peterse 654c4dd922
Refactor API noteable types constants
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.
2019-03-04 17:44:56 +01:00

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