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

Version Path
hyrax-5.0.1 app/models/sipity/notification.rb
hyrax-5.0.0 app/models/sipity/notification.rb
hyrax-5.0.0.rc3 app/models/sipity/notification.rb
hyrax-5.0.0.rc2 app/models/sipity/notification.rb
hyrax-5.0.0.rc1 app/models/sipity/notification.rb
hyrax-3.6.0 app/models/sipity/notification.rb
hyrax-4.0.0 app/models/sipity/notification.rb
hyrax-4.0.0.rc3 app/models/sipity/notification.rb
hyrax-4.0.0.rc2 app/models/sipity/notification.rb
hyrax-4.0.0.rc1 app/models/sipity/notification.rb
hyrax-3.5.0 app/models/sipity/notification.rb
hyrax-4.0.0.beta2 app/models/sipity/notification.rb
hyrax-3.4.2 app/models/sipity/notification.rb
hyrax-4.0.0.beta1 app/models/sipity/notification.rb
hyrax-3.4.1 app/models/sipity/notification.rb
hyrax-3.4.0 app/models/sipity/notification.rb
hyrax-3.3.0 app/models/sipity/notification.rb
hyrax-3.2.0 app/models/sipity/notification.rb
hyrax-3.1.0 app/models/sipity/notification.rb
hyrax-3.0.2 app/models/sipity/notification.rb