Skip to content

Commit

Permalink
dm-4157 search page bullet warning fix (#721)
Browse files Browse the repository at this point in the history
* refactor #origin_display_name

breaks into helper methods

implements conditional preloading for `PracticeOriginFacilities` query

* fix conditional in `origin_display_name`

* fix conditional in `origin_display_name`
  • Loading branch information
PhilipDeFraties authored Oct 18, 2023
1 parent 7080da9 commit 76e077f
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions app/helpers/application_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,14 @@ def determine_associations(practice)
end

def construct_facility_name(loc)
has_va_facility = loc.va_facility.present?
official_station_name = has_va_facility ? loc.va_facility.official_station_name : loc.clinical_resource_hub.official_station_name
common_name = loc.va_facility.common_name if has_va_facility
has_va_facility ? facility_name_with_common_name(official_station_name, common_name) : official_station_name
if loc.va_facility.present?
facility_name_with_common_name(
loc.va_facility.official_station_name,
loc.va_facility.common_name
)
else
loc.clinical_resource_hub.official_station_name
end
end

def handle_initiating_facility(practice)
Expand Down

0 comments on commit 76e077f

Please sign in to comment.