Sha256: 1519acb7514c4b227b567d3ca18970e12e3aac8d3e5476af8d9503fbcc734b3a

Contents?: true

Size: 555 Bytes

Versions: 8

Compression:

Stored size: 555 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

8 entries across 8 versions & 1 rubygems

Version Path
renalware-core-2.0.0.pre.beta11 app/models/renalware/clinics/appointment.rb
renalware-core-2.0.0.pre.beta10 app/models/renalware/clinics/appointment.rb
renalware-core-2.0.0.pre.beta9 app/models/renalware/clinics/appointment.rb
renalware-core-2.0.0.pre.beta8 app/models/renalware/clinics/appointment.rb
renalware-core-2.0.0.pre.beta7 app/models/renalware/clinics/appointment.rb
renalware-core-2.0.0.pre.beta6 app/models/renalware/clinics/appointment.rb
renalware-core-2.0.0.pre.beta5 app/models/renalware/clinics/appointment.rb
renalware-core-2.0.0.pre.beta4 app/models/renalware/clinics/appointment.rb