diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/api/helpers/resource_label_events_helpers.rb | 13 | ||||
-rw-r--r-- | lib/api/resource_label_events.rb | 4 |
2 files changed, 14 insertions, 3 deletions
diff --git a/lib/api/helpers/resource_label_events_helpers.rb b/lib/api/helpers/resource_label_events_helpers.rb new file mode 100644 index 00000000000..23574deb59b --- /dev/null +++ b/lib/api/helpers/resource_label_events_helpers.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +module API + module Helpers + module ResourceLabelEventsHelpers + def self.eventable_types + # This is a method instead of a constant, allowing EE to more easily + # extend it. + [Issue, MergeRequest] + end + end + end +end diff --git a/lib/api/resource_label_events.rb b/lib/api/resource_label_events.rb index 0c328f7268e..448bef12cec 100644 --- a/lib/api/resource_label_events.rb +++ b/lib/api/resource_label_events.rb @@ -7,9 +7,7 @@ module API before { authenticate! } - EVENTABLE_TYPES = [Issue, MergeRequest].freeze - - EVENTABLE_TYPES.each do |eventable_type| + Helpers::ResourceLabelEventsHelpers.eventable_types.each do |eventable_type| parent_type = eventable_type.parent_class.to_s.underscore eventables_str = eventable_type.to_s.underscore.pluralize |