Class: Discussions::ResolveService
- Inherits:
-
BaseService
- Object
- BaseService
- BaseService
- Discussions::ResolveService
- Includes:
- Gitlab::Utils::StrongMemoize
- Defined in:
- app/services/discussions/resolve_service.rb
Instance Attribute Summary
Attributes inherited from BaseService
#current_user, #params, #project
Instance Method Summary collapse
- #execute ⇒ Object
-
#initialize(project, user = nil, params = {}) ⇒ ResolveService
constructor
A new instance of ResolveService.
Methods included from BaseServiceUtility
#deny_visibility_level, #event_service, #log_error, #log_info, #notification_service, #system_hook_service, #todo_service, #visibility_level
Methods included from Gitlab::Allowable
Constructor Details
#initialize(project, user = nil, params = {}) ⇒ ResolveService
Returns a new instance of ResolveService.
7 8 9 10 11 12 13 14 15 16 |
# File 'app/services/discussions/resolve_service.rb', line 7 def initialize(project, user = nil, params = {}) @discussions = Array.wrap(params.fetch(:one_or_more_discussions)) @follow_up_issue = params[:follow_up_issue] @resolved_count = 0 raise ArgumentError, 'Discussions must be all for the same noteable' \ unless noteable_is_same? super end |
Instance Method Details
#execute ⇒ Object
18 19 20 21 22 |
# File 'app/services/discussions/resolve_service.rb', line 18 def execute discussions.each { |discussion| resolve_discussion(discussion) } after_resolve_cleanup end |