diff --git a/lib/govuk_publishing_components/app_helpers/taxon_breadcrumbs.rb b/lib/govuk_publishing_components/app_helpers/taxon_breadcrumbs.rb index aa096f902e..13d909cbf4 100644 --- a/lib/govuk_publishing_components/app_helpers/taxon_breadcrumbs.rb +++ b/lib/govuk_publishing_components/app_helpers/taxon_breadcrumbs.rb @@ -52,14 +52,10 @@ def initialize(content_item) end def parent_taxon - parent_taxons.first - end + @_parent_taxon ||= begin + parent_content_item = content_item.dig("links", "parent_taxons", 0) - def parent_taxons - @_parent_taxons ||= begin - content_item.dig("links", "parent_taxons") - .to_a - .map { |taxon| ContentItem.new(taxon) } + ContentItem.new(parent_content_item) unless parent_content_item.nil? end end