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

17 lines
424 B
Ruby
Raw Normal View History

2018-10-07 01:53:31 +08:00
# frozen_string_literal: true
module Api
module V1
class TaskGroupSerializer < ActiveModel::Serializer
type :task_groups
attributes :id
has_many :my_modules, key: :tasks,
serializer: TaskSerializer,
class_name: 'MyModule',
2021-07-23 17:56:28 +08:00
unless: -> { object.my_modules.blank? }
include TimestampableModel
2018-10-07 01:53:31 +08:00
end
end
end