Class: Renalware::Modalities::Modality

Inherits:
ApplicationRecord show all
Includes:
Accountable, PatientScope
Defined in:
app/models/renalware/modalities/modality.rb

Instance Method Summary collapse

Methods included from Accountable

#first_or_create_by!, #save_by, #save_by!, #update_by

Instance Method Details

#terminate_by(user, on:) ⇒ Object



25
26
27
28
29
# File 'app/models/renalware/modalities/modality.rb', line 25

def terminate_by(user, on:)
  self.ended_on = on
  self.state = "terminated"
  save_by!(user)
end

#terminated?Boolean

Returns:

  • (Boolean)


35
36
37
# File 'app/models/renalware/modalities/modality.rb', line 35

def terminated?
  state == "terminated"
end

#to_sObject



31
32
33
# File 'app/models/renalware/modalities/modality.rb', line 31

def to_s
  description.name
end