fix: semester_process_volunteer factory may crete hours with group_assignment...

fix: semester_process_volunteer factory may crete hours with group_assignment instead of group_offer relation
parent 13b801be
Pipeline #39370 passed with stage
in 36 minutes and 43 seconds
......@@ -71,7 +71,8 @@ FactoryBot.define do
if ev.add_hours
spv.semester_process_volunteer_missions.map do |sem_proc_mission|
create(:hour, hourable: sem_proc_mission.mission)
hourable = sem_proc_mission.mission.assignment? ? sem_proc_mission.mission : sem_proc_mission.mission.group_offer
create(:hour, hourable: hourable, volunteer: spv.volunteer)
end
end
end
......
......@@ -57,21 +57,21 @@ FactoryBot.define do
end
trait :fake_single_assignments do
man { [true, false].sample }
woman { [true, false].sample }
family { [true, false].sample }
kid { [true, false].sample }
teenager { [true, false].sample }
unaccompanied { [true, false].sample }
man { FFaker::Boolean.maybe }
woman { FFaker::Boolean.maybe }
family { FFaker::Boolean.maybe }
kid { FFaker::Boolean.maybe }
teenager { FFaker::Boolean.maybe }
unaccompanied { FFaker::Boolean.maybe }
end
trait :fake_availability do
flexible { [true, false].sample }
morning { [true, false].sample }
afternoon { [true, false].sample }
evening { [true, false].sample }
workday { [true, false].sample }
weekend { [true, false].sample }
flexible { FFaker::Boolean.maybe }
morning { FFaker::Boolean.maybe }
afternoon { FFaker::Boolean.maybe }
evening { FFaker::Boolean.maybe }
workday { FFaker::Boolean.maybe }
weekend { FFaker::Boolean.maybe }
end
trait :imported do
......
Markdown is supported
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