2018-09-11 15:13:17 +08:00
|
|
|
# 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,
|
2018-09-11 16:31:16 +08:00
|
|
|
:project_id, :experiment_id
|
2018-09-13 17:46:25 +08:00
|
|
|
attribute :my_module_id, key: :task_id
|
2018-09-07 21:19:20 +08:00
|
|
|
belongs_to :my_module, serializer: MyModuleSerializer
|
2018-09-26 18:17:49 +08:00
|
|
|
belongs_to :experiment, serializer: ExperimentSerializer
|
2018-09-11 15:13:17 +08:00
|
|
|
belongs_to :project, serializer: ProjectSerializer
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|