Commit 6552b09f authored by Jiri Strojil's avatar Jiri Strojil 💬
Browse files

Merge branch 'fixes/cannot-create-semester-process' into 'develop'

Bug: can't create SemesterProcess

See merge request !846
parents a6ba64af 8eab7cc8
Pipeline #30819 passed with stage
in 48 minutes and 10 seconds
......@@ -36,7 +36,7 @@ class SemesterProcessesController < ApplicationController
mail_subject_template: semester_process_params[:subject]
)
@semester_process.build_semester_volunteers(@volunteers, selected_volunteers: selected_volunteers)
@semester_process.build_semester_volunteers(@volunteers, selected_volunteers)
@semester_process.build_volunteers_hours_feedbacks_and_mails
if @semester_process.save
......
......@@ -69,7 +69,7 @@ class SemesterProcess < ApplicationRecord
end
def build_semester_volunteers(volunteers, selected = nil)
volunteers = volunteers.where(id: selected) if selected
volunteers = volunteers.select{ |volunteer| selected.include? volunteer.id } if selected && selected.any?
semester_process_volunteers << volunteers.to_a.map do |volunteer|
spv = SemesterProcessVolunteer.new(volunteer: volunteer, selected: false)
spv.build_missions(semester)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment