Skip to content

Commit

Permalink
correctly fetch xml from metadata in api
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin Fenner committed Dec 27, 2018
1 parent 86ef13e commit 997e7fd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/serializers/doi_serializer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class DoiSerializer
has_many :media

attribute :xml, if: Proc.new { |object, params| params && params[:detail] } do |object|
object.xml_encoded || (object.current_metadata.present? && object.current_metadata.xml.to_s.start_with?('<?xml version=') ? Base64.strict_encode64(object.current_metadata.xml.force_encoding("UTF-8")) : nil)
object.xml_encoded || object.current_metadata.present? ? object.from_xml(object.current_metadata.xml.to_s.force_encoding("UTF-8")) : nil
end

attribute :doi do |object|
Expand Down

0 comments on commit 997e7fd

Please sign in to comment.