Class: MergeRequests::ReloadDiffsService

Inherits:
Object
  • Object
show all
Defined in:
app/services/merge_requests/reload_diffs_service.rb

Instance Method Summary collapse

Constructor Details

#initialize(merge_request, current_user) ⇒ ReloadDiffsService

Returns a new instance of ReloadDiffsService.


5
6
7
8
# File 'app/services/merge_requests/reload_diffs_service.rb', line 5

def initialize(merge_request, current_user)
  @merge_request = merge_request
  @current_user = current_user
end

Instance Method Details

#executeObject


10
11
12
13
14
15
16
# File 'app/services/merge_requests/reload_diffs_service.rb', line 10

def execute
  old_diff_refs = merge_request.diff_refs
  new_diff = merge_request.create_merge_request_diff

  clear_cache(new_diff)
  update_diff_discussion_positions(old_diff_refs)
end