Skip to content

Commit

Permalink
Fix ContentRowPresenter if document_type.nil?
Browse files Browse the repository at this point in the history
`humanize(nil)` currently raises ``NoMethodError: undefined method `end_with?' for nil:NilClass`` due to a regression in Rails 7.0.6 (see rails/rails#48800)
  • Loading branch information
robinjam committed Jul 25, 2023
1 parent 34e9450 commit d709b5e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/presenters/content_row_presenter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def initialize(data)
@title = data[:title]
@base_path = format_base_path(data[:base_path])
@raw_document_type = data[:document_type]
@document_type = humanize(data[:document_type])
@document_type = humanize(data[:document_type] || "")
@sibling_order = format_sibling_order(data[:sibling_order])
@upviews = number_with_delimiter(data[:upviews], delimiter: ",") || "No data"
@satisfaction_percentage = format_satisfaction_percentage(data[:satisfaction])
Expand Down

0 comments on commit d709b5e

Please sign in to comment.