Sha256: 3321b760f6e0fc31bf6ec82cd5f981260f5924fbe6e6337aa231d68538bb4cf0
Contents?: true
Size: 944 Bytes
Versions: 25
Compression:
Stored size: 944 Bytes
Contents
# frozen_string_literal: true module Sipity # Responsible for defining a notification that is associated with a given # context; I believe the context is something that will be triggered via # an action however, I don't believe this needs to be a "hard" # relationship. It is instead a polymorphic relationship. class Notification < ActiveRecord::Base self.table_name = 'sipity_notifications' has_many :notifiable_contexts, dependent: :destroy, class_name: 'Sipity::NotifiableContext' has_many :recipients, dependent: :destroy, class_name: 'Sipity::NotificationRecipient' NOTIFICATION_TYPE_EMAIL = 'email' # TODO: There are other types, but for now, we are assuming just emails to send. enum(notification_type: { NOTIFICATION_TYPE_EMAIL => NOTIFICATION_TYPE_EMAIL }) def self.valid_notification_types notification_types.keys end end end
Version data entries
25 entries across 25 versions & 1 rubygems