Class: Discussions::CaptureDiffNotePositionsService

Inherits:
Object
  • Object
show all
Defined in:
app/services/discussions/capture_diff_note_positions_service.rb

Instance Method Summary collapse

Constructor Details

#initialize(merge_request) ⇒ CaptureDiffNotePositionsService

Returns a new instance of CaptureDiffNotePositionsService.


5
6
7
# File 'app/services/discussions/capture_diff_note_positions_service.rb', line 5

def initialize(merge_request)
  @merge_request = merge_request
end

Instance Method Details

#executeObject


9
10
11
12
13
14
15
16
17
18
19
# File 'app/services/discussions/capture_diff_note_positions_service.rb', line 9

def execute
  return unless merge_request.has_complete_diff_refs?

  discussions, paths = build_discussions

  service = Discussions::CaptureDiffNotePositionService.new(merge_request, paths)

  discussions.each do |discussion|
    service.execute(discussion)
  end
end