This website requires JavaScript.
Explore
Help
Sign in
kotovalexarian-likes-gitlab
/
gitlab-org--gitlab-foss
Watch
1
Star
0
Fork
You've already forked gitlab-org--gitlab-foss
0
Code
Releases
Activity
01be32043a
gitlab-org--gitlab-foss
/
app
/
observers
/
note_observer.rb
6 lines
101 B
Ruby
Raw
Normal View
History
Unescape
Escape
refactor observers. Added BaseObserver with helper methods
2013-03-26 12:11:38 -04:00
class
NoteObserver
<
BaseObserver
Separate observing of Note and MergeRequests * Move is_assigned? and is_being_xx? methods to IssueCommonality This is behavior merge requests have in common with issues. Moved methods to IssueCommonality role. Put specs directly into merge_request_spec because setup differs for issues and MRs specifically in the "closed" factory to use. * Add MergeRequestObserver. Parallels IssueObserver in almost every way. Ripe for refactoring. * Rename MailerObserver to NoteObserver With merge request observing moved out of MailerObserver, all that was left was Note logic. Renamed to NoteObserver, added tests and updated application config for new observer names. Refactored NoteObserver to use the note's author and not rely on current_user. * Set current_user for MergeRequestObserver IssueObserver and MergeRequestObserver are the only observers that need a reference to the current_user that they cannot look up on the objects they are observing.
2012-10-09 18:25:29 -04:00
def
after_create
(
note
)
Move new_note email logic to NotificationService
2013-03-26 11:51:06 -04:00
notification
.
new_note
(
note
)
Rename NoteObserver methods and clarify things
2012-10-13 16:46:27 -04:00
end
Separate observing of Note and MergeRequests * Move is_assigned? and is_being_xx? methods to IssueCommonality This is behavior merge requests have in common with issues. Moved methods to IssueCommonality role. Put specs directly into merge_request_spec because setup differs for issues and MRs specifically in the "closed" factory to use. * Add MergeRequestObserver. Parallels IssueObserver in almost every way. Ripe for refactoring. * Rename MailerObserver to NoteObserver With merge request observing moved out of MailerObserver, all that was left was Note logic. Renamed to NoteObserver, added tests and updated application config for new observer names. Refactored NoteObserver to use the note's author and not rely on current_user. * Set current_user for MergeRequestObserver IssueObserver and MergeRequestObserver are the only observers that need a reference to the current_user that they cannot look up on the objects they are observing.
2012-10-09 18:25:29 -04:00
end
Copy permalink