Skip to content

Commit

Permalink
opt-out showing related-identifiers in api. #482
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin Fenner committed Apr 21, 2020
1 parent c59856b commit 33e32f5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions app/controllers/dois_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,7 @@ def index
options[:params] = {
current_ability: current_ability,
detail: params[:detail],
composite: params[:composite],
affiliation: params[:affiliation],
is_collection: options[:is_collection],
}
Expand Down Expand Up @@ -292,6 +293,7 @@ def show
options[:params] = {
current_ability: current_ability,
detail: true,
composite: nil,
affiliation: params[:affiliation],
}

Expand Down
2 changes: 1 addition & 1 deletion app/serializers/doi_serializer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ class DoiSerializer
Array.wrap(object.identifiers)
end

attribute :related_identifiers do |object|
attribute :related_identifiers, if: Proc.new { |object, params| params && params[:composite].blank? } do |object|
Array.wrap(object.related_identifiers)
end

Expand Down

0 comments on commit 33e32f5

Please sign in to comment.