Hound is love, Hound is life

This commit is contained in:
Luka Murn 2018-10-11 08:51:14 +02:00
parent dd4f7b5d02
commit c0f47f03b7

View file

@ -7,21 +7,25 @@ module Api
attributes :id, :message
belongs_to :user, serializer: UserSerializer
belongs_to :project, serializer: ProjectSerializer,
if: -> { object.class == ProjectComment &&
!instance_options[:hide_project] }
belongs_to :project,
serializer: ProjectSerializer,
if: -> { object.class == ProjectComment &&
!instance_options[:hide_project] }
# TODO
#belongs_to :my_module, serializer: TaskSerializer,
# key: :task,
# class_name: 'MyModule',
# if: -> { object.class == TaskComment &&
# !instance_options[:hide_task] }
#belongs_to :step, serializer: StepSerializer,
# if: -> { object.class == StepComment &&
# !instance_options[:hide_step] }
belongs_to :result, serializer: ResultSerializer,
if: -> { object.class == ResultComment &&
!instance_options[:hide_result] }
#belongs_to :my_module,
# serializer: TaskSerializer,
# key: :task,
# class_name: 'MyModule',
# if: -> { object.class == TaskComment &&
# !instance_options[:hide_task] }
#belongs_to :step,
# serializer: StepSerializer,
# if: -> { object.class == StepComment &&
# !instance_options[:hide_step] }
belongs_to :result,
serializer: ResultSerializer,
if: -> { object.class == ResultComment &&
!instance_options[:hide_result] }
end
end
end