Class: NotificationRecipients::Builder::NewReview
- Inherits:
-
Base
- Object
- Base
- NotificationRecipients::Builder::NewReview
show all
- Defined in:
- app/services/notification_recipients/builder/new_review.rb
Instance Attribute Summary collapse
Instance Method Summary
collapse
Methods inherited from Base
#add_recipients, #filter!, #make_recipient, #notification_recipients, #recipients, #recipients_target, #user_scope
Constructor Details
#initialize(review) ⇒ NewReview
Returns a new instance of NewReview.
8
9
10
|
# File 'app/services/notification_recipients/builder/new_review.rb', line 8
def initialize(review)
@review = review
end
|
Instance Attribute Details
#review ⇒ Object
Returns the value of attribute review.
6
7
8
|
# File 'app/services/notification_recipients/builder/new_review.rb', line 6
def review
@review
end
|
Instance Method Details
#acting_user ⇒ Object
39
40
41
|
# File 'app/services/notification_recipients/builder/new_review.rb', line 39
def acting_user
review.author
end
|
#build! ⇒ Object
24
25
26
27
28
29
30
|
# File 'app/services/notification_recipients/builder/new_review.rb', line 24
def build!
add_participants(review.author)
add_mentions(review.author, target: review)
add_project_watchers
add_custom_notifications
add_subscribed_users
end
|
#custom_action ⇒ Object
A new review is a batch of new notes therefore new_note subscribers should also receive incoming new reviews
35
36
37
|
# File 'app/services/notification_recipients/builder/new_review.rb', line 35
def custom_action
:new_note
end
|
#group ⇒ Object
20
21
22
|
# File 'app/services/notification_recipients/builder/new_review.rb', line 20
def group
project.group
end
|
#project ⇒ Object
16
17
18
|
# File 'app/services/notification_recipients/builder/new_review.rb', line 16
def project
review.project
end
|
#target ⇒ Object
12
13
14
|
# File 'app/services/notification_recipients/builder/new_review.rb', line 12
def target
review.merge_request
end
|