From 5926bbac12d5831e1ad90964272b96e152a72e34 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Tue, 31 Jul 2012 08:32:49 +0300 Subject: Backend Refactoring --- app/controllers/notes_controller.rb | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'app/controllers/notes_controller.rb') diff --git a/app/controllers/notes_controller.rb b/app/controllers/notes_controller.rb index 1c997e380a0..e8e4bb544a8 100644 --- a/app/controllers/notes_controller.rb +++ b/app/controllers/notes_controller.rb @@ -15,11 +15,7 @@ class NotesController < ApplicationController end def create - @note = @project.notes.new(params[:note]) - @note.author = current_user - @note.notify = true if params[:notify] == '1' - @note.notify_author = true if params[:notify_author] == '1' - @note.save + @note = Notes::CreateContext.new(project, current_user, params).execute respond_to do |format| format.html {redirect_to :back} @@ -40,6 +36,6 @@ class NotesController < ApplicationController protected def notes - @notes = NotesLoad.new(project, current_user, params).execute + @notes = Notes::LoadContext.new(project, current_user, params).execute end end -- cgit v1.2.1