From e19713f5df355150a99b07c2d20f3a5be2693815 Mon Sep 17 00:00:00 2001 From: f Date: Mon, 17 May 2021 12:43:23 -0300 Subject: [PATCH] =?UTF-8?q?usar=20Post#new=3F=20que=20ya=20sabe=20cu=C3=A1?= =?UTF-8?q?ndo=20el=20documento=20no=20existe=20aun?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/metadata_document_date.rb | 2 +- app/models/post.rb | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/app/models/metadata_document_date.rb b/app/models/metadata_document_date.rb index 312bb3af..7512cbfb 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 461733f9..13e8a919 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