We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 67f79fd commit 20ba138Copy full SHA for 20ba138
1 file changed
app/presenters/api/v2/plan_presenter.rb
@@ -60,7 +60,7 @@ def plan_costs(plan:)
60
61
# Fetch all questions and answers from a plan, regardless of theme
62
def fetch_all_q_and_a
63
- answers = @plan.answers.includes(:question)
+ answers = @plan.answers.includes(question: [:section])
64
return [] unless answers.present?
65
66
answers.filter_map do |answer|
@@ -69,6 +69,7 @@ def fetch_all_q_and_a
69
70
{
71
title: "Question #{q.number || q.id}",
72
+ section: q.section&.title,
73
question: q.text.to_s,
74
answer: answer.text.to_s
75
}
0 commit comments