Whitespace
This commit is contained in:
@@ -4,4 +4,4 @@ class PushNotificationJob < ApplicationJob
|
||||
def perform(notification)
|
||||
NotificationPusher.new(notification).push
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -9,4 +9,4 @@ module PushNotifiable
|
||||
def push_notification_later
|
||||
PushNotificationJob.perform_later(self)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
class Notification < ApplicationRecord
|
||||
include PushNotifiable
|
||||
|
||||
|
||||
belongs_to :user
|
||||
belongs_to :creator, class_name: "User"
|
||||
belongs_to :source, polymorphic: true
|
||||
|
||||
+1
-1
@@ -2,4 +2,4 @@ module Push
|
||||
def self.table_name_prefix
|
||||
"push_"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Rails.application.configure do
|
||||
config.x.vapid.private_key = ENV.fetch("VAPID_PRIVATE_KEY", Rails.application.credentials.dig(:vapid, :private_key))
|
||||
config.x.vapid.public_key = ENV.fetch("VAPID_PUBLIC_KEY", Rails.application.credentials.dig(:vapid, :public_key))
|
||||
end
|
||||
end
|
||||
|
||||
@@ -7,11 +7,11 @@ class AddPushSubscriptions < ActiveRecord::Migration[8.1]
|
||||
t.string :auth_key
|
||||
t.string :user_agent
|
||||
t.timestamps
|
||||
|
||||
t.index [:user_id, :endpoint], unique: true
|
||||
|
||||
t.index [ :user_id, :endpoint ], unique: true
|
||||
t.index :endpoint
|
||||
t.index :user_agent
|
||||
t.index ["endpoint", "p256dh_key", "auth_key"]
|
||||
t.index [ "endpoint", "p256dh_key", "auth_key" ]
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user