Browse Source

CLDC-2895 Add squish to the names of locations, schemes, users, and institutions

pull/2004/head
David May-Miller 3 years ago
parent
commit
7e6c2fdfb3
  1. 2
      app/models/location.rb
  2. 2
      app/models/organisation.rb
  3. 2
      app/models/scheme.rb
  4. 2
      app/models/user.rb

2
app/models/location.rb

@ -16,7 +16,7 @@ class Location < ApplicationRecord
before_validation :lookup_postcode!, if: :postcode_changed?
auto_strip_attributes :name
auto_strip_attributes :name, squish: true
scope :search_by_postcode, ->(postcode) { where("REPLACE(postcode, ' ', '') ILIKE ?", "%#{postcode.delete(' ')}%") }
scope :search_by_name, ->(name) { where("name ILIKE ?", "%#{name}%") }

2
app/models/organisation.rb

@ -36,7 +36,7 @@ class Organisation < ApplicationRecord
has_paper_trail
auto_strip_attributes :name
auto_strip_attributes :name, squish: true
PROVIDER_TYPE = {
LA: 1,

2
app/models/scheme.rb

@ -75,7 +75,7 @@ class Scheme < ApplicationRecord
validate :validate_confirmed
validate :validate_owning_organisation
auto_strip_attributes :service_name
auto_strip_attributes :service_name, squish: true
SENSITIVE = {
No: 0,

2
app/models/user.rb

@ -38,7 +38,7 @@ class User < ApplicationRecord
has_one_time_password(encrypted: true)
auto_strip_attributes :name
auto_strip_attributes :name, squish: true
ROLES = {
data_provider: 1,

Loading…
Cancel
Save