summaryrefslogtreecommitdiff
path: root/app/contexts/notes/create_context.rb
blob: d93adb835ef927d6374268651c85fcc43d0868a4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
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