Browse Source

highlight missing field

pull/671/head
JG 3 years ago
parent
commit
7059ced7de
  1. 2
      app/models/scheme.rb
  2. 5
      config/locales/en.yml

2
app/models/scheme.rb

@ -10,6 +10,8 @@ class Scheme < ApplicationRecord
scope :search_by_postcode, ->(postcode) { joins(:locations).where("locations.postcode ILIKE ?", "%#{postcode.delete(' ')}%") }
scope :search_by, ->(param) { search_by_postcode(param).or(search_by_service_name(param)).or(search_by_code(param)).distinct }
validates :organisation_id, presence: { message: I18n.t("validations.scheme.organisation_id_missing") }
SENSITIVE = {
No: 0,
Yes: 1,

5
config/locales/en.yml

@ -44,9 +44,12 @@ en:
scheme:
attributes:
organisation:
required: "Enter the organisation’s name"
required: ""
validations:
scheme:
organisation_id_missing: "Enter the organisation’s name"
organisation:
name_missing: "Enter the organisation’s name"
provider_type_missing: "Select the organisation’s type"

Loading…
Cancel
Save