fc56ad9d7c
- Switch to binary 16 for UUID keys - Remove AccountScopedRecord base class, all model use binary uuids now - Fix the search sql to serialize uuids properly - Patch the MySQL schema dumper to output binary lengths
9 lines
303 B
Ruby
9 lines
303 B
Ruby
class Push::Subscription < ApplicationRecord
|
|
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
|