1
0

notification_request_serializer.rb 414 B

12345678910111213141516
  1. # frozen_string_literal: true
  2. class REST::NotificationRequestSerializer < ActiveModel::Serializer
  3. attributes :id, :created_at, :updated_at, :notifications_count
  4. belongs_to :from_account, key: :account, serializer: REST::AccountSerializer
  5. belongs_to :last_status, serializer: REST::StatusSerializer
  6. def id
  7. object.id.to_s
  8. end
  9. def notifications_count
  10. object.notifications_count.to_s
  11. end
  12. end