Skip to content

Commit

Permalink
Update current_part_body to return an empty string if nil
Browse files Browse the repository at this point in the history
Replaces the need to create a body_for_metadata method:
alphagov/government-frontend@74f6e4e
  • Loading branch information
leenagupte committed Sep 13, 2024
1 parent ecaa45d commit a9de3d9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/models/concerns/parts.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def current_part_title
end

def current_part_body
current_part["body"]
current_part["body"] || ""
end

def current_part_path
Expand Down
2 changes: 1 addition & 1 deletion app/views/travel_advice/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
schema: :article,
canonical_url: canonical_url(@content_item.current_part_path),
title: @content_item.page_title,
body: @content_item.body_for_metadata,
body: @content_item.current_part_body,
content_item: content_item_hash %>
<% end %>

Expand Down

0 comments on commit a9de3d9

Please sign in to comment.