gitlabhq/app/contexts/notes/create_context.rb
2012-12-03 22:51:55 +01:00

12 lines
293 B
Ruby

module Notes
class CreateContext < BaseContext
def execute
note = project.notes.new(params[:note])
note.author = current_user
note.notify = params[:notify].present?
note.notify_author = params[:notify_author].present?
note.save
note
end
end
end