Skip to content

Commit

Permalink
only check schema version for new record. #197
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin Fenner committed Feb 6, 2019
1 parent 4f073c1 commit 5df2820
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/xml_schema_validator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 5df2820

Please sign in to comment.