Skip to content

Commit

Permalink
show doi associations only for detail view. #390
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin Fenner committed Feb 15, 2020
1 parent 2777933 commit c8326d2
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions app/serializers/doi_serializer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit c8326d2

Please sign in to comment.