class NotifyLogEntry
Schema Information
Table name: notify_log_entries
id :bigint not null, primary key
body :text
delivery_status :integer default("sending"), not null
purpose :integer not null
recipient :string not null
subject :text
type :integer not null
created_at :datetime not null
consent_form_id :bigint
delivery_id :uuid
parent_id :bigint
patient_id :bigint
sent_by_user_id :bigint
template_id :uuid not null
Indexes
index_notify_log_entries_on_consent_form_id (consent_form_id) index_notify_log_entries_on_delivery_id (delivery_id) index_notify_log_entries_on_parent_id (parent_id) index_notify_log_entries_on_patient_id (patient_id) index_notify_log_entries_on_sent_by_user_id (sent_by_user_id)
Foreign Keys
fk_rails_... (consent_form_id => consent_forms.id) fk_rails_... (parent_id => parents.id) ON DELETE => nullify fk_rails_... (patient_id => patients.id) ON DELETE => cascade fk_rails_... (sent_by_user_id => users.id)
Constants
- RETIRED_TEMPLATE_IDS
-
Retired Notify-hosted template UUIDs, kept so we can display the template name when rendering old notify_log_entries that reference them.
Public Instance Methods
Source
# File app/models/notify_log_entry.rb, line 160 def programmes = notify_log_entry_programmes.map(&:programme) private def template_name return unless email? || sms? template = NotifyTemplate.find_by_id(template_id, channel: type.to_sym) template&.name || RETIRED_TEMPLATE_IDS[template_id.to_s] end end
Source
# File app/models/notify_log_entry.rb, line 164 def template_name return unless email? || sms? template = NotifyTemplate.find_by_id(template_id, channel: type.to_sym) template&.name || RETIRED_TEMPLATE_IDS[template_id.to_s] end
Source
# File app/models/notify_log_entry.rb, line 155 def title template_name&.to_s&.humanize.presence || "Unknown #{human_enum_name(:type)}" end