infusionvlc/ConexionFelina

View on GitHub
app/models/treatment_entry.rb

Summary

Maintainability
A
0 mins
Test Coverage
class TreatmentEntry < ApplicationRecord
  MAXIMUM_CHARACTERS = 1024

  enum treatments: [:surgery, :diet, :medicine, :hospitalized, :hosted]

  belongs_to :suffering

  validates :date, presence: true
  validates :treatment, presence: true
  validates :notes, length: {maximum: MAXIMUM_CHARACTERS}

  validates_with TreatmentEntryValidator
end