From dd4a9dd4d906eedd9009db936b7bd49f6c11de0b Mon Sep 17 00:00:00 2001 From: Martin Fenner Date: Wed, 26 Sep 2018 12:57:19 +0200 Subject: [PATCH] only save xml on changes --- app/models/doi.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/doi.rb b/app/models/doi.rb index 7ed51f379..6ba5755ee 100644 --- a/app/models/doi.rb +++ b/app/models/doi.rb @@ -483,7 +483,7 @@ def update_metadata attribute_will_change!(:xml) end - metadata.build(doi: self, xml: xml, namespace: schema_version) if xml.present? + metadata.build(doi: self, xml: xml, namespace: schema_version) if (changed & %w(xml)).present? end def set_defaults