mirror of
https://0xacab.org/sutty/sutty
synced 2024-11-14 18:01:42 +00:00
usar Post#new? que ya sabe cuándo el documento no existe aun
This commit is contained in:
parent
64b59bfc4d
commit
e19713f5df
2 changed files with 2 additions and 4 deletions
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue