summaryrefslogtreecommitdiff
path: root/app/controllers/notes_controller.rb
diff options
context:
space:
mode:
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