ministryofjustice/Claim-for-Crown-Court-Defence

View on GitHub
app/models/location.rb

Summary

Maintainability
A
0 mins
Test Coverage
A
100%
# == Schema Information
#
# Table name: locations
#
#  id         :integer          not null, primary key
#  name       :string
#  created_at :datetime
#  updated_at :datetime
#

class Location < ApplicationRecord
  auto_strip_attributes :name, squish: true, nullify: true

  has_many :case_workers

  validates :name, presence: true, uniqueness: { case_sensitive: false }

  def to_s
    name
  end
end