From 64b59bfc4dc996f9a0e2391dc328cba9a13a9631 Mon Sep 17 00:00:00 2001 From: f Date: Fri, 14 May 2021 17:41:44 -0300 Subject: [PATCH] si el post ya tiene fecha, no cambiarla --- app/models/metadata_document_date.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/models/metadata_document_date.rb b/app/models/metadata_document_date.rb index 82126ba..312bb3a 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 @@ -42,7 +44,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