1
0
Fork 0
mirror of https://github.com/mastodon/mastodon.git synced 2024-08-20 21:08:15 -07:00

Reuse REST::RoleSerializer in REST::AccountSerializer

This commit is contained in:
Emelia Smith 2024-07-27 17:21:04 +02:00
parent dd53792714
commit 3d08ea81a9
No known key found for this signature in database

View file

@ -30,15 +30,7 @@ class REST::AccountSerializer < ActiveModel::Serializer
end end
end end
class RoleSerializer < ActiveModel::Serializer has_many :roles, serializer: REST::RoleSerializer, if: :local?
attributes :id, :name, :color
def id
object.id.to_s
end
end
has_many :roles, serializer: RoleSerializer, if: :local?
class FieldSerializer < ActiveModel::Serializer class FieldSerializer < ActiveModel::Serializer
include FormattingHelper include FormattingHelper