gitlab-org--gitlab-foss/app/contexts/notes/create_context.rb

13 lines
305 B
Ruby
Raw Normal View History

2012-07-31 05:32:49 +00:00
module Notes
class CreateContext < BaseContext
def execute
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
end
end
end