Replace `webpush` gem in `add_webpush_app` migration

This commit is contained in:
Andreas Nedbal 2024-01-22 23:43:06 +01:00 committed by Andreas Nedbal
parent 6c2314de2d
commit f1a0edd06e
1 changed files with 2 additions and 2 deletions

View File

@ -1,10 +1,10 @@
# frozen_string_literal: true
require "webpush"
require "web-push"
class AddWebpushApp < ActiveRecord::Migration[6.1]
def up
vapid_keypair = Webpush.generate_key.to_hash
vapid_keypair = WebPush.generate_key.to_hash
app = Rpush::Webpush::App.new
app.name = "webpush"
app.certificate = vapid_keypair.merge(subject: APP_CONFIG.fetch("contact_email")).to_json