From ae1af26b233be2e03b9b2e1b1e84cd56e5745bf4 Mon Sep 17 00:00:00 2001 From: JG Date: Wed, 13 Jul 2022 09:16:52 +0100 Subject: [PATCH] location validations --- app/models/location.rb | 1 + config/locales/en.yml | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/app/models/location.rb b/app/models/location.rb index a44640889..f16feae1c 100644 --- a/app/models/location.rb +++ b/app/models/location.rb @@ -1,5 +1,6 @@ class Location < ApplicationRecord validate :validate_postcode + validates :total_units, :type_of_unit, :wheelchair_adaptation, presence: true belongs_to :scheme before_save :infer_la!, if: :postcode_changed? diff --git a/config/locales/en.yml b/config/locales/en.yml index 9c6ac8ece..adf76cab7 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -68,6 +68,14 @@ en: invalid: "Select if this scheme provides for another client group" support_services_provider: invalid: "Select who provides the support services used by this scheme" + location: + attributes: + wheelchair_adaptation: + blank: "Enter the existing organisation’s name" + total_units: + blank: "Enter the existing organisation’s name" + type_of_unit: + blank: "Enter the existing organisation’s name" validations: