From 3d08ea81a988a93026eaa249225b60abfb56397d Mon Sep 17 00:00:00 2001 From: Emelia Smith Date: Sat, 27 Jul 2024 17:21:04 +0200 Subject: [PATCH] Reuse REST::RoleSerializer in REST::AccountSerializer --- app/serializers/rest/account_serializer.rb | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/app/serializers/rest/account_serializer.rb b/app/serializers/rest/account_serializer.rb index 354d384464d..e2866800f52 100644 --- a/app/serializers/rest/account_serializer.rb +++ b/app/serializers/rest/account_serializer.rb @@ -30,15 +30,7 @@ class REST::AccountSerializer < ActiveModel::Serializer end end - class RoleSerializer < ActiveModel::Serializer - attributes :id, :name, :color - - def id - object.id.to_s - end - end - - has_many :roles, serializer: RoleSerializer, if: :local? + has_many :roles, serializer: REST::RoleSerializer, if: :local? class FieldSerializer < ActiveModel::Serializer include FormattingHelper