diff --git a/app/models/doi.rb b/app/models/doi.rb index bb2812a5a..97c9d0c7e 100644 --- a/app/models/doi.rb +++ b/app/models/doi.rb @@ -431,7 +431,7 @@ def self.import_by_day_missing(options={}) logger = Logger.new(STDOUT) - Doi.where(schema_version: nil).where(created: from_date.midnight..from_date.end_of_day).find_each do |doi| + Doi.where(xml: nil).where(created: from_date.midnight..from_date.end_of_day).find_each do |doi| begin string = doi.current_metadata.present? ? doi.from_xml(doi.current_metadata.xml.to_s.force_encoding("UTF-8")) : nil unless string.present? diff --git a/app/serializers/doi_serializer.rb b/app/serializers/doi_serializer.rb index aae42e277..e74824873 100644 --- a/app/serializers/doi_serializer.rb +++ b/app/serializers/doi_serializer.rb @@ -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.from_xml(object.current_metadata.xml.to_s.force_encoding("UTF-8")) : nil + object.xml_encoded end attribute :doi do |object|