Sha256: df2a99860c1793d26ab6c0e16e70d09074780edf2e9f485eb7791be2008ebf64

Contents?: true

Size: 554 Bytes

Versions: 1

Compression:

Stored size: 554 Bytes

Contents

require_dependency "renalware/clinics"

module Renalware
  module Clinics
    class Appointment < ApplicationRecord
      belongs_to :patient, touch: true
      belongs_to :clinic
      belongs_to :user

      validates_presence_of :starts_at
      validates_presence_of :patient
      validates_presence_of :clinic
      validates_presence_of :user

      validates :starts_at, timeliness: { type: :datetime }

      def starts_on
        starts_at.to_date
      end

      def start_time
        starts_at.strftime("%H:%M")
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
renalware-core-2.0.0.pre.beta12 app/models/renalware/clinics/appointment.rb