This website requires JavaScript.
Explore
Help
Sign In
deac
/
gitlabhq
Watch
1
Star
0
Fork
You've already forked gitlabhq
0
Code
Issues
Pull requests
Releases
Wiki
Activity
ce0945efcd
gitlabhq
/
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 17:11:38 +01: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-10 00:25:29 +02:00
def
after_create
(
note
)
Move new_note email logic to NotificationService
2013-03-26 16:51:06 +01:00
notification
.
new_note
(
note
)
Rename NoteObserver methods and clarify things
2012-10-13 22:46:27 +02: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-10 00:25:29 +02:00
end
Reference in a new issue
Copy permalink