diff options
author | kibigo! <marrus-sh@users.noreply.github.com> | 2017-07-12 02:03:17 -0700 |
---|---|---|
committer | kibigo! <marrus-sh@users.noreply.github.com> | 2017-07-12 02:03:17 -0700 |
commit | 79d898ae0ad8c0e66bd63ec3e0904e9e5e7894e8 (patch) | |
tree | ee8d832ed2f11e9afe62daf0e586a86004eb8d98 /app/serializers/rest/notification_serializer.rb | |
parent | bcf7ee48e94cd2e4d2de28e8854e7f0e2b5cad1f (diff) | |
parent | 056b5ed72f6d980bceeb49eb249b8365fe8fce66 (diff) |
Merge upstream!! #64 <3 <3
Diffstat (limited to 'app/serializers/rest/notification_serializer.rb')
-rw-r--r-- | app/serializers/rest/notification_serializer.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/app/serializers/rest/notification_serializer.rb b/app/serializers/rest/notification_serializer.rb new file mode 100644 index 000000000..f95d099a3 --- /dev/null +++ b/app/serializers/rest/notification_serializer.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +class REST::NotificationSerializer < ActiveModel::Serializer + attributes :id, :type, :created_at + + belongs_to :from_account, key: :account, serializer: REST::AccountSerializer + belongs_to :target_status, key: :status, if: :status_type?, serializer: REST::StatusSerializer + + def status_type? + [:favourite, :reblog, :mention].include?(object.type) + end +end |