diff --git a/app/models/location.rb b/app/models/location.rb index a4dedd6ae..76e3e577e 100644 --- a/app/models/location.rb +++ b/app/models/location.rb @@ -1,22 +1,20 @@ class Location < ApplicationRecord belongs_to :scheme - WHEELCHAIR_ADAPTATION = { - 0 => "No", - 1 => "Yes", + WHEELCHAIR_ADAPTATIONS = { + no: 0, + yes: 1, }.freeze + enum wheelchair_adaptation: WHEELCHAIR_ADAPTATIONS + def display_attributes [ { name: "Location code ", value: location_code, suffix: false }, { name: "Postcode", value: postcode, suffix: county }, { name: "Type of unit", value: type_of_unit, suffix: false }, { name: "Type of building", value: type_of_building, suffix: false }, - { name: "Wheelchair adaptation", value: wheelchair_adaptation_display, suffix: false }, + { name: "Wheelchair adaptation", value: wheelchair_adaptation, suffix: false }, ] end - - def wheelchair_adaptation_display - WHEELCHAIR_ADAPTATION[wheelchair_adaptation] - end end