notification_policy_serializer.rb 587 B

12345678910111213141516171819
  1. # frozen_string_literal: true
  2. class REST::NotificationPolicySerializer < ActiveModel::Serializer
  3. # Please update `app/javascript/mastodon/api_types/notification_policies.ts` when making changes to the attributes
  4. attributes :for_not_following,
  5. :for_not_followers,
  6. :for_new_accounts,
  7. :for_private_mentions,
  8. :for_limited_accounts,
  9. :summary
  10. def summary
  11. {
  12. pending_requests_count: object.pending_requests_count.to_i,
  13. pending_notifications_count: object.pending_notifications_count.to_i,
  14. }
  15. end
  16. end