From 4a678a92af44a554b2c2a17efc477dcb29a7c106 Mon Sep 17 00:00:00 2001 From: kosiakkatrina <54268893+kosiakkatrina@users.noreply.github.com> Date: Thu, 28 Jul 2022 12:22:05 +0100 Subject: [PATCH] remove base error for the schemes (#790) --- app/models/scheme.rb | 1 - config/locales/en.yml | 2 -- spec/requests/schemes_controller_spec.rb | 2 +- 3 files changed, 1 insertion(+), 4 deletions(-) diff --git a/app/models/scheme.rb b/app/models/scheme.rb index 5ac48b310..41f757d15 100644 --- a/app/models/scheme.rb +++ b/app/models/scheme.rb @@ -214,7 +214,6 @@ class Scheme < ApplicationRecord if confirmed == true required_attributes.any? do |attribute| if self[attribute].blank? - errors.add :base errors.add attribute.to_sym self.confirmed = false end diff --git a/config/locales/en.yml b/config/locales/en.yml index c139d9c31..5110730db 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -65,8 +65,6 @@ en: invalid: "Select if this scheme provides for another client group" arrangement_type: invalid: "Select who provides the support services used by this scheme" - base: - invalid: "You must answer all the required questions for this scheme" location: attributes: startdate: diff --git a/spec/requests/schemes_controller_spec.rb b/spec/requests/schemes_controller_spec.rb index ecf244761..2e853a922 100644 --- a/spec/requests/schemes_controller_spec.rb +++ b/spec/requests/schemes_controller_spec.rb @@ -586,7 +586,7 @@ RSpec.describe SchemesController, type: :request do it "does not allow the scheme to be confirmed" do expect(response).to have_http_status(:unprocessable_entity) - expect(page).to have_content(I18n.t("activerecord.errors.models.scheme.attributes.base.invalid")) + expect(page).to have_content(I18n.t("activerecord.errors.models.scheme.attributes.managing_organisation_id.invalid")) end end