From 3843ce85e027badb49281c9c65287b25ccdcd28b Mon Sep 17 00:00:00 2001 From: ColinW520 Date: Tue, 6 Aug 2019 12:37:25 -0600 Subject: [PATCH] refactor: use a decorator to present the start list --- app/decorators/participant_decorator.rb | 4 ++++ app/views/participants/_table_row.html.haml | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/app/decorators/participant_decorator.rb b/app/decorators/participant_decorator.rb index a1305c32..826537d1 100644 --- a/app/decorators/participant_decorator.rb +++ b/app/decorators/participant_decorator.rb @@ -3,6 +3,10 @@ def address_html "#{address}
#{city}, #{state}, #{zip}" end + def city_and_state + "#{participant.city.try(:titleize)}, #{participant.state.try(:upcase)}" + end + def full_name "#{first_name} #{last_name}" end diff --git a/app/views/participants/_table_row.html.haml b/app/views/participants/_table_row.html.haml index 1828d748..5a53e672 100644 --- a/app/views/participants/_table_row.html.haml +++ b/app/views/participants/_table_row.html.haml @@ -3,6 +3,6 @@ %td= participant.last_name %td= participant.division[0].upcase %td= participant.race_day_age - %td #{participant.city}, #{participant.state} + %td= participant.city_and_state - if participant.event.allows_teams? %td= participant.team_name