Class: Notes::PostProcessService

Inherits:
Object
  • Object
show all
Defined in:
app/services/notes/post_process_service.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(note) ⇒ PostProcessService

Returns a new instance of PostProcessService.



7
8
9
# File 'app/services/notes/post_process_service.rb', line 7

def initialize(note)
  @note = note
end

Instance Attribute Details

#noteObject

Returns the value of attribute note.



5
6
7
# File 'app/services/notes/post_process_service.rb', line 5

def note
  @note
end

Instance Method Details

#executeObject



11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'app/services/notes/post_process_service.rb', line 11

def execute
  # Skip system notes, like status changes and cross-references and awards
  unless note.system?
    EventCreateService.new.leave_note(note, note.author)

    return if note.for_personal_snippet?

    note.create_cross_references!
    ::SystemNoteService.design_discussion_added(note) if create_design_discussion_system_note?

    execute_note_hooks
  end
end