diff --git a/app/services/guidance_service.rb b/app/services/guidance_service.rb index 929b3c7..d79329c 100644 --- a/app/services/guidance_service.rb +++ b/app/services/guidance_service.rb @@ -63,6 +63,7 @@ # { guidance_group: { theme: [guidance, ...], ... }, ... } def guidance_groups_by_theme(org: nil, question: nil) raise ArgumentError unless question.respond_to?(:themes) + question = Question.includes(:themes).find(question.id) return {} unless hashified_guidance_groups.has_key?(org) return hashified_guidance_groups[org].each_key.reduce({}) do |acc, gg| filtered_gg = hashified_guidance_groups[org][gg].each_key.reduce({}) do |acc, theme|