Browse Source

Make sure nil IDs to not get cast to empty string in REST API (#5068)

pull/4/head
Eugen Rochko 6 years ago
committed by GitHub
parent
commit
adc38078dd
2 changed files with 3 additions and 3 deletions
  1. +1
    -1
      app/serializers/rest/application_serializer.rb
  2. +2
    -2
      app/serializers/rest/status_serializer.rb

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

@ -9,7 +9,7 @@ class REST::ApplicationSerializer < ActiveModel::Serializer
end
def client_id
object.uid.to_s
object.uid
end
def client_secret

+ 2
- 2
app/serializers/rest/status_serializer.rb View File

@ -24,11 +24,11 @@ class REST::StatusSerializer < ActiveModel::Serializer
end
def in_reply_to_id
object.in_reply_to_id.to_s
object.in_reply_to_id&.to_s
end
def in_reply_to_account_id
object.in_reply_to_account_id.to_s
object.in_reply_to_account_id&.to_s
end
def current_user?

Loading…
Cancel
Save