Commit 8eab7cc8 authored by Jiri Strojil's avatar Jiri Strojil
Browse files

Fixed the error

parent 47e66be3
Pipeline #30811 passed with stage
in 36 minutes and 46 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