Skip to content

Commit 20ba138

Browse files
committed
Update plan_presenter
1 parent 67f79fd commit 20ba138

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

app/presenters/api/v2/plan_presenter.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ def plan_costs(plan:)
6060

6161
# Fetch all questions and answers from a plan, regardless of theme
6262
def fetch_all_q_and_a
63-
answers = @plan.answers.includes(:question)
63+
answers = @plan.answers.includes(question: [:section])
6464
return [] unless answers.present?
6565

6666
answers.filter_map do |answer|
@@ -69,6 +69,7 @@ def fetch_all_q_and_a
6969

7070
{
7171
title: "Question #{q.number || q.id}",
72+
section: q.section&.title,
7273
question: q.text.to_s,
7374
answer: answer.text.to_s
7475
}

0 commit comments

Comments
 (0)