From c8326d2e02178ccefacfb77c4ee86c06af3be3f5 Mon Sep 17 00:00:00 2001 From: Martin Fenner Date: Sat, 15 Feb 2020 15:42:01 +0100 Subject: [PATCH] show doi associations only for detail view. #390 --- app/serializers/doi_serializer.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/serializers/doi_serializer.rb b/app/serializers/doi_serializer.rb index c234fa2b4..50e42f1e9 100644 --- a/app/serializers/doi_serializer.rb +++ b/app/serializers/doi_serializer.rb @@ -11,10 +11,10 @@ class DoiSerializer belongs_to :client, record_type: :clients has_many :media, record_type: :media, id_method_name: :uid, if: Proc.new { |object, params| params && params[:detail] && !params[:is_collection]} - has_many :references, serializer: DoiSerializer - has_many :citations, serializer: DoiSerializer - has_many :parts, serializer: DoiSerializer - has_many :versions, serializer: DoiSerializer + has_many :references, serializer: DoiSerializer, if: Proc.new { |object, params| params && params[:detail] } + has_many :citations, serializer: DoiSerializer, if: Proc.new { |object, params| params && params[:detail] } + has_many :parts, serializer: DoiSerializer, if: Proc.new { |object, params| params && params[:detail] } + has_many :versions, serializer: DoiSerializer, if: Proc.new { |object, params| params && params[:detail] } attribute :xml, if: Proc.new { |object, params| params && params[:detail] } do |object| begin