Class: Discussions::UnresolveService

Inherits:
BaseService show all
Includes:
Gitlab::Utils::StrongMemoize
Defined in:
app/services/discussions/unresolve_service.rb

Instance Attribute Summary

Attributes inherited from BaseService

#current_user, #params, #project

Instance Method Summary collapse

Methods included from Gitlab::Utils::StrongMemoize

#clear_memoization, #strong_memoize, #strong_memoized?

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

#can?

Constructor Details

#initialize(discussion, user) ⇒ UnresolveService

Returns a new instance of UnresolveService.


7
8
9
10
11
12
# File 'app/services/discussions/unresolve_service.rb', line 7

def initialize(discussion, user)
  @discussion = discussion
  @user = user

  super
end

Instance Method Details

#executeObject


14
15
16
17
18
19
# File 'app/services/discussions/unresolve_service.rb', line 14

def execute
  @discussion.unresolve!

  Gitlab::UsageDataCounters::MergeRequestActivityUniqueCounter
    .track_unresolve_thread_action(user: @user)
end