Class: EventCreateService

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

Overview

EventCreateService class

Used for creating events feed on dashboard after certain user action

Ex.

EventCreateService.new.new_issue(issue, current_user)

Instance Method Summary collapse

Instance Method Details

#close_issue(issue, current_user) ⇒ Object


13
14
15
# File 'app/services/event_create_service.rb', line 13

def close_issue(issue, current_user)
  create_record_event(issue, current_user, Event::CLOSED)
end

#close_milestone(milestone, current_user) ⇒ Object


41
42
43
# File 'app/services/event_create_service.rb', line 41

def close_milestone(milestone, current_user)
  create_record_event(milestone, current_user, Event::CLOSED)
end

#close_mr(merge_request, current_user) ⇒ Object


25
26
27
# File 'app/services/event_create_service.rb', line 25

def close_mr(merge_request, current_user)
  create_record_event(merge_request, current_user, Event::CLOSED)
end

#create_project(project, current_user) ⇒ Object


65
66
67
# File 'app/services/event_create_service.rb', line 65

def create_project(project, current_user)
  create_event(project, current_user, Event::CREATED)
end

#destroy_milestone(milestone, current_user) ⇒ Object


49
50
51
# File 'app/services/event_create_service.rb', line 49

def destroy_milestone(milestone, current_user)
  create_record_event(milestone, current_user, Event::DESTROYED)
end

#join_project(project, current_user) ⇒ Object


57
58
59
# File 'app/services/event_create_service.rb', line 57

def join_project(project, current_user)
  create_event(project, current_user, Event::JOINED)
end

#leave_note(note, current_user) ⇒ Object


53
54
55
# File 'app/services/event_create_service.rb', line 53

def leave_note(note, current_user)
  create_record_event(note, current_user, Event::COMMENTED)
end

#leave_project(project, current_user) ⇒ Object


61
62
63
# File 'app/services/event_create_service.rb', line 61

def leave_project(project, current_user)
  create_event(project, current_user, Event::LEFT)
end

#merge_mr(merge_request, current_user) ⇒ Object


33
34
35
# File 'app/services/event_create_service.rb', line 33

def merge_mr(merge_request, current_user)
  create_record_event(merge_request, current_user, Event::MERGED)
end

#open_issue(issue, current_user) ⇒ Object


9
10
11
# File 'app/services/event_create_service.rb', line 9

def open_issue(issue, current_user)
  create_record_event(issue, current_user, Event::CREATED)
end

#open_milestone(milestone, current_user) ⇒ Object


37
38
39
# File 'app/services/event_create_service.rb', line 37

def open_milestone(milestone, current_user)
  create_record_event(milestone, current_user, Event::CREATED)
end

#open_mr(merge_request, current_user) ⇒ Object


21
22
23
# File 'app/services/event_create_service.rb', line 21

def open_mr(merge_request, current_user)
  create_record_event(merge_request, current_user, Event::CREATED)
end

#push(project, current_user, push_data) ⇒ Object


69
70
71
# File 'app/services/event_create_service.rb', line 69

def push(project, current_user, push_data)
  create_event(project, current_user, Event::PUSHED, data: push_data)
end

#reopen_issue(issue, current_user) ⇒ Object


17
18
19
# File 'app/services/event_create_service.rb', line 17

def reopen_issue(issue, current_user)
  create_record_event(issue, current_user, Event::REOPENED)
end

#reopen_milestone(milestone, current_user) ⇒ Object


45
46
47
# File 'app/services/event_create_service.rb', line 45

def reopen_milestone(milestone, current_user)
  create_record_event(milestone, current_user, Event::REOPENED)
end

#reopen_mr(merge_request, current_user) ⇒ Object


29
30
31
# File 'app/services/event_create_service.rb', line 29

def reopen_mr(merge_request, current_user)
  create_record_event(merge_request, current_user, Event::REOPENED)
end