0
0
Fork 1
Spiegel von https://github.com/paviliondev/discourse-custom-wizard.git synchronisiert 2024-11-29 12:20:27 +01:00
discourse-custom-wizard/serializers/api/api_serializer.rb

20 Zeilen
465 B
Ruby

2019-05-31 09:54:11 +02:00
class CustomWizard::ApiSerializer < ApplicationSerializer
attributes :service,
:authorization,
:endpoints
def authorization
CustomWizard::Api::AuthorizationSerializer.new(
CustomWizard::Api::Authorization.get(object.service),
root: false
)
end
def endpoints
ActiveModel::ArraySerializer.new(
CustomWizard::Api::Endpoint.list,
each_serializer: CustomWizard::Api::EndpointSerializer
)
end
end