scinote-web/app/serializers/api/v1/project_serializer.rb

17 lines
359 B
Ruby
Raw Normal View History

2018-09-10 22:20:02 +08:00
# frozen_string_literal: true
module Api
module V1
class ProjectSerializer < ActiveModel::Serializer
type :projects
attributes :name, :visibility, :start_date, :archived
belongs_to :project_folder, serializer: ProjectFolderSerializer
def start_date
2018-11-07 23:39:00 +08:00
I18n.l(object.created_at, format: :full)
end
2018-09-10 22:20:02 +08:00
end
end
end