mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-09-16 10:06:57 +08:00
17 lines
581 B
Ruby
17 lines
581 B
Ruby
# frozen_string_literal: true
|
|
|
|
module Api
|
|
module V1
|
|
class ProjectSerializer < ActiveModel::Serializer
|
|
type :projects
|
|
attributes :name, :status, :visibility, :archived, :started_at, :done_at, :start_date, :due_date, :description
|
|
attribute :metadata, if: -> { scope && scope[:metadata] == true }
|
|
|
|
belongs_to :project_folder, serializer: ProjectFolderSerializer
|
|
belongs_to :supervised_by, serializer: UserSerializer
|
|
has_many :project_comments, key: :comments, serializer: CommentSerializer
|
|
|
|
include TimestampableModel
|
|
end
|
|
end
|
|
end
|