summaryrefslogtreecommitdiff
path: root/app/controllers/notes_controller.rb
diff options
context:
space:
mode:
authorValery Sizov <vsv2711@gmail.com>2011-12-17 15:58:35 +0200
committerValery Sizov <vsv2711@gmail.com>2011-12-17 15:58:35 +0200
commit7713f7fefb4601b7ddede29d61fbf80e2b2929b8 (patch)
treecb8226a5e2b73a8cb25739ded45a1d292e57a40b /app/controllers/notes_controller.rb
parentf7859ec1ed9061abe467fb9860e9d87514e4b2e1 (diff)
downloadgitlab-ce-7713f7fefb4601b7ddede29d61fbf80e2b2929b8.tar.gz
Notification refactoring
Diffstat (limited to 'app/controllers/notes_controller.rb')
-rw-r--r--app/controllers/notes_controller.rb24
1 files changed, 2 insertions, 22 deletions
diff --git a/app/controllers/notes_controller.rb b/app/controllers/notes_controller.rb
index b8e04f1c1a8..5d99d1e273e 100644
--- a/app/controllers/notes_controller.rb
+++ b/app/controllers/notes_controller.rb
@@ -12,10 +12,8 @@ class NotesController < ApplicationController
def create
@note = @project.notes.new(params[:note])
@note.author = current_user
-
- if @note.save
- notify if params[:notify] == '1'
- end
+ @note.notify = true if params[:notify] == '1'
+ @note.save
respond_to do |format|
format.html {redirect_to :back}
@@ -35,22 +33,4 @@ class NotesController < ApplicationController
end
end
- protected
-
- def notify
- @project.users.reject { |u| u.id == current_user.id } .each do |u|
- case @note.noteable_type
- when "Commit" then
- Notify.note_commit_email(u, @note).deliver
- when "Issue" then
- Notify.note_issue_email(u, @note).deliver
- when "MergeRequest"
- true # someone should write email notification
- when "Snippet"
- true
- else
- Notify.note_wall_email(u, @note).deliver
- end
- end
- end
end