Class: Types::WorkItems::Widgets::DevelopmentType

Inherits:
BaseObject
  • Object
show all
Defined in:
app/graphql/types/work_items/widgets/development_type.rb

Overview

Disabling widget level authorization as it might be too granular and we already authorize the parent work item rubocop:disable Graphql/AuthorizeTypes – reason above

Instance Method Summary collapse

Methods inherited from BaseObject

accepts, assignable?, authorization, authorization_scopes, authorize, authorized?, #current_user, #id

Methods included from Gitlab::Graphql::Present

#present, #unpresented

Instance Method Details

#closing_merge_requestsObject



48
49
50
51
52
53
54
# File 'app/graphql/types/work_items/widgets/development_type.rb', line 48

def closing_merge_requests
  if object.closing_merge_requests.loaded?
    object.closing_merge_requests
  else
    object.closing_merge_requests.preload_merge_request_for_authorization
  end
end


40
41
42
43
44
45
46
# File 'app/graphql/types/work_items/widgets/development_type.rb', line 40

def related_branches
  return [] unless object.work_item.project

  ::Issues::RelatedBranchesService
    .new(container: object.work_item.project, current_user: current_user)
    .execute(object.work_item)
end