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:
parent
dd53792714
commit
3d08ea81a9
1 changed files with 1 additions and 9 deletions
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue