Skip to content

Commit eda5dcc

Browse files
committed
make displayed_dietary_restrictions nil-safe
1 parent 3fabf63 commit eda5dcc

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

app/presenters/member_presenter.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ def pairing_details_array(role, tutorial, note)
2424
end
2525

2626
def displayed_dietary_restrictions
27+
return [] if dietary_restrictions.nil?
28+
2729
(dietary_restrictions - ['other']).map(&:humanize).tap do |drs|
2830
drs << other_dietary_restrictions if other_dietary_restrictions? && other_dietary_restrictions.present?
2931
end.map(&:upcase_first)

0 commit comments

Comments
 (0)