module HocNotifications::ActsAsHocNotificationsNotifiable::ClassMethods

Public Instance Methods

acts_as_hoc_notifications_notifiable(**options) click to toggle source
# File lib/hoc_notifications/acts_as_hoc_notifications_notifiable.rb, line 9
def acts_as_hoc_notifications_notifiable(**options)
  has_many :notifications,
  as: :notifiable,
  class_name: 'HocNotifications::HocNotification',
  dependent: :nullify

end
create_notification(sender:, recipients:, notifiable:, action:, title:, message:, **data) click to toggle source
# File lib/hoc_notifications/acts_as_hoc_notifications_notifiable.rb, line 17
def create_notification(sender:, recipients:, notifiable:, action:, title:, message:, **data)
  HocNotifications::HocNotification.create_notifications(
    sender: sender,
    recipients: recipients,
    notifiable: notifiable,
    action: action,
    title: title,
    message: message,
    **data
  )
end