Spiegel von
https://github.com/paviliondev/discourse-custom-wizard.git
synchronisiert 2025-02-19 19:07:02 +01:00
20 Zeilen
465 B
Ruby
20 Zeilen
465 B
Ruby
![]() |
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
|