diff --git a/app/models/metadata_document_date.rb b/app/models/metadata_document_date.rb index 312bb3a..7512cbf 100644 --- a/app/models/metadata_document_date.rb +++ b/app/models/metadata_document_date.rb @@ -8,7 +8,7 @@ class MetadataDocumentDate < MetadataTemplate end def value_from_document - return nil unless document.path + return nil if post.new? document.date end diff --git a/app/models/post.rb b/app/models/post.rb index 461733f..13e8a91 100644 --- a/app/models/post.rb +++ b/app/models/post.rb @@ -49,9 +49,7 @@ class Post public_send(attr)&.value = args[attr] if args.key?(attr) end - # XXX: No usamos Post#read porque a esta altura todavĂ­a no sabemos - # nada del Document - document.read! if File.exist? document.path + document.read! unless new? end def inspect