scinote-web/app/serializers/api/v2/result_serializer.rb
wandji 465c8d1f80
Unify API step and result elements controllers implementation and types [SCI-9907] (#6854)
* Unify api step and result elements controllers implementation and types [SCI-9907]

* Update wrong serializer types [SCI-9907]

* Rename result and step text types [SCI-9907]

* Combine result and step assets serializer [SCI-9907]
2024-01-08 10:31:14 +01:00

19 lines
687 B
Ruby

# frozen_string_literal: true
module Api
module V2
class ResultSerializer < ActiveModel::Serializer
type :results
attributes :name, :archived
belongs_to :user, serializer: Api::V1::UserSerializer
has_many :result_comments, key: :comments, serializer: Api::V1::CommentSerializer
has_many :result_texts, key: :result_texts, serializer: ResultTextSerializer
has_many :result_tables, key: :tables, serializer: ResultTableSerializer
has_many :assets, serializer: AssetSerializer
has_many :result_orderable_elements, key: :result_elements, serializer: ResultOrderableElementSerializer
include TimestampableModel
end
end
end