Sha256: ad09b8f9ce87750372ab31d392cc666f099431a3cdea8948088c5ee76fd9f08a
Contents?: true
Size: 606 Bytes
Versions: 16
Compression:
Stored size: 606 Bytes
Contents
class Notification < ApplicationRecord belongs_to :user belongs_to :organization belongs_to :target, polymorphic: true, optional: true enum subject: %i( custom exam_authorization_request_updated exam_registration) scope :notified_users_ids_for, ->(target, organization=Organization.current) do where(target: target, organization: organization).pluck(:user_id) end def mark_as_read! update read: true end def self.create_and_notify_via_email!(args) create!(args).tap(&:notify_via_email!) end def notify_via_email! user.notify_via_email! self end end
Version data entries
16 entries across 16 versions & 1 rubygems