bring back semester feedback prefill in case spv has one

in case a SemesterProcessVolunteer record has semester_feedbacks.any? the first is taken for the prefill
parent 7ee2e10e
Pipeline #35440 failed with stage
in 40 minutes and 44 seconds
...@@ -64,6 +64,12 @@ class JournalsController < ApplicationController ...@@ -64,6 +64,12 @@ class JournalsController < ApplicationController
@semester_process_volunteer = SemesterProcessVolunteer.find(params[:sp_volunteer_id]) @semester_process_volunteer = SemesterProcessVolunteer.find(params[:sp_volunteer_id])
@journal.journalable = @semester_process_volunteer.volunteer @journal.journalable = @semester_process_volunteer.volunteer
@journal.title = "Semester Prozess Feedback vom #{I18n.l(@semester_process_volunteer.created_at.to_date)}: " @journal.title = "Semester Prozess Feedback vom #{I18n.l(@semester_process_volunteer.created_at.to_date)}: "
@semester_feedback = @semester_process_volunteer.semester_feedbacks&.first
return unless @semester_feedback
@journal.body = @semester_feedback.slice(:goals, :achievements, :future, :comments).map do |key, sfb_quote|
"#{I18n.t("{key}")}:\n«#{sfb_quote}»" if sfb_quote.present?
end end
def journal_params def journal_params
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