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

17 lines
473 B
Ruby
Raw Normal View History

# frozen_string_literal: true
module Api
module V1
class ActivitySerializer < ActiveModel::Serializer
type :activities
2018-09-26 18:17:49 +08:00
2018-09-13 17:46:25 +08:00
attributes :id, :user_id, :type_of, :message,
:project_id, :experiment_id
2018-09-13 17:46:25 +08:00
attribute :my_module_id, key: :task_id
belongs_to :my_module, serializer: MyModuleSerializer
2018-09-26 18:17:49 +08:00
belongs_to :experiment, serializer: ExperimentSerializer
belongs_to :project, serializer: ProjectSerializer
end
end
end