Browse Source

Fix notifications including wrong status in JSON (#4097)

pull/4/head
Eugen Rochko 5 years ago
committed by GitHub
parent
commit
6e1261f277
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      app/serializers/rest/notification_serializer.rb

+ 1
- 1
app/serializers/rest/notification_serializer.rb View File

@ -4,7 +4,7 @@ class REST::NotificationSerializer < ActiveModel::Serializer
attributes :id, :type, :created_at
belongs_to :from_account, key: :account, serializer: REST::AccountSerializer
belongs_to :status, if: :status_type?, serializer: REST::StatusSerializer
belongs_to :target_status, key: :status, if: :status_type?, serializer: REST::StatusSerializer
def status_type?
[:favourite, :reblog, :mention].include?(object.type)

Loading…
Cancel
Save