Add db table and models
This commit is contained in:
@@ -0,0 +1,7 @@
|
||||
class Push::Subscription < ApplicationRecord
|
||||
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
|
||||
Reference in New Issue
Block a user