mirror of
https://0xacab.org/sutty/sutty
synced 2024-11-21 22:46:21 +00:00
poder generar artículos con un uuid y lang determinado
This commit is contained in:
parent
ca9b6db2c9
commit
8e99332b33
1 changed files with 7 additions and 7 deletions
|
@ -60,11 +60,11 @@ class Post < OpenStruct
|
|||
end
|
||||
|
||||
# TODO: Llamar dinámicamente
|
||||
load_lang!
|
||||
load_slug!
|
||||
load_lang! args[:lang]
|
||||
load_uuid! args[:uuid]
|
||||
load_date!
|
||||
load_slug!
|
||||
load_path!
|
||||
load_uuid!
|
||||
|
||||
# XXX: No usamos Post#read porque a esta altura todavía no sabemos
|
||||
# nada del Document
|
||||
|
@ -372,18 +372,18 @@ class Post < OpenStruct
|
|||
required: true)
|
||||
end
|
||||
|
||||
def load_lang!
|
||||
def load_lang!(lang = nil)
|
||||
self.lang = MetadataLang.new(document: document, site: site,
|
||||
layout: layout, name: :lang,
|
||||
type: :lang, post: self,
|
||||
required: true)
|
||||
value: lang, required: true)
|
||||
end
|
||||
|
||||
def load_uuid!
|
||||
def load_uuid!(uuid = nil)
|
||||
self.uuid = MetadataUuid.new(document: document, site: site,
|
||||
layout: layout, name: :uuid,
|
||||
type: :uuid, post: self,
|
||||
required: true)
|
||||
value: uuid, required: true)
|
||||
end
|
||||
|
||||
# Ejecuta la acción de guardado en cada atributo
|
||||
|
|
Loading…
Reference in a new issue