peimelo/controlled_health_api

View on GitHub
app/models/reference.rb

Summary

Maintainability
A
0 mins
Test Coverage
A
100%
class Reference < ApplicationRecord
  include Sortable

  has_many :exam_reference, dependent: :restrict_with_exception

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

  def self.sort_by
    %w[name]
  end

  private_class_method :sort_by
end