diff --git a/app/models/metadata_document_date.rb b/app/models/metadata_document_date.rb index cc303b6..a07c559 100644 --- a/app/models/metadata_document_date.rb +++ b/app/models/metadata_document_date.rb @@ -8,6 +8,8 @@ class MetadataDocumentDate < MetadataTemplate end def value_from_document + return nil unless document.path + document.date end @@ -46,7 +48,7 @@ class MetadataDocumentDate < MetadataTemplate value_from_document || default_value end else - value_from_document || default_value + self[:value] || value_from_document || default_value end end