e4011ef211
- schema changes to primary and foreign keys - fixture changes - customer data models subclass AccountScopedRecord - import script updated
9 lines
305 B
Ruby
9 lines
305 B
Ruby
class Push::Subscription < AccountScopedRecord
|
|
belongs_to :account, default: -> { Current.account }
|
|
belongs_to :user
|
|
|
|
def notification(**params)
|
|
WebPush::Notification.new(**params, badge: user.notifications.unread.count, endpoint: endpoint, p256dh_key: p256dh_key, auth_key: auth_key)
|
|
end
|
|
end
|