From 5df2820db69e11760af4cef918f1427723ab0073 Mon Sep 17 00:00:00 2001 From: Martin Fenner Date: Wed, 6 Feb 2019 07:36:59 +0100 Subject: [PATCH] only check schema version for new record. #197 --- lib/xml_schema_validator.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/xml_schema_validator.rb b/lib/xml_schema_validator.rb index 199050630..672779af9 100644 --- a/lib/xml_schema_validator.rb +++ b/lib/xml_schema_validator.rb @@ -35,7 +35,7 @@ def validate_each(record, attribute, value) kernel = get_valid_kernel(record.schema_version) return false unless kernel.present? - if ["http://datacite.org/schema/kernel-2.2", "http://datacite.org/schema/kernel-2.2"].include?(record.schema_version) + if record.new_record? && ["http://datacite.org/schema/kernel-2.2", "http://datacite.org/schema/kernel-2.2"].include?(record.schema_version) record.errors[:xml] << "Schema #{record.schema_version} is no longer supported" return false end