Skip to content

Commit 7cbabba

Browse files
committed
Simplify vaccination_record_location
Now that either the `location_id` or the `location_name` is set on vaccination records we can simplify this method to check either one or the other and get the same result as we do currently.
1 parent f5782df commit 7cbabba

File tree

1 file changed

+2
-11
lines changed

1 file changed

+2
-11
lines changed

app/helpers/vaccination_records_helper.rb

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,8 @@
22

33
module VaccinationRecordsHelper
44
def vaccination_record_location(vaccination_record)
5-
if (location = vaccination_record.location)
6-
if location.generic_clinic?
7-
vaccination_record.location_name
8-
elsif vaccination_record.already_had?
9-
"Unknown"
10-
else
11-
location.name
12-
end
13-
else
14-
vaccination_record.location_name
15-
end
5+
vaccination_record.location_name.presence ||
6+
vaccination_record.location&.name || "Unknown"
167
end
178

189
def vaccination_record_status_tag(vaccination_record)

0 commit comments

Comments
 (0)