Class: NotificationRecipient

Inherits:
ApplicationRecord show all
Defined in:
app/models/notification_recipient.rb

Instance Method Summary collapse

Methods inherited from ApplicationRecord

graphql_type, #logger, logger

Methods included from AuditAssociations::AssociationsDefinitions

#audit_associations, #audited, #configure_dirty_associations, #normalize_associations

Instance Method Details

#current_user?Boolean

Returns:

  • (Boolean)

24
25
26
# File 'app/models/notification_recipient.rb', line 24

def current_user?
  User.current.id == user_id
end

#payloadObject


12
13
14
15
16
17
18
19
20
21
22
# File 'app/models/notification_recipient.rb', line 12

def payload
  {
    :id         => id,
    :seen       => seen,
    :level      => notification_blueprint.level,
    :text       => notification.message,
    :created_at => notification.created_at.utc,
    :group      => notification_blueprint.group,
    :actions    => notification.actions,
  }
end