闭社主体 forked from https://github.com/tootsuite/mastodon
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

13 lines
277 B

  1. # frozen_string_literal: true
  2. class REST::WebPushSubscriptionSerializer < ActiveModel::Serializer
  3. attributes :id, :endpoint, :alerts, :server_key
  4. def alerts
  5. object.data&.dig('alerts') || {}
  6. end
  7. def server_key
  8. Rails.configuration.x.vapid_public_key
  9. end
  10. end