mirror of
https://0xacab.org/sutty/sutty
synced 2024-11-22 04:06: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
|
end
|
||||||
|
|
||||||
# TODO: Llamar dinámicamente
|
# TODO: Llamar dinámicamente
|
||||||
load_lang!
|
load_lang! args[:lang]
|
||||||
load_slug!
|
load_uuid! args[:uuid]
|
||||||
load_date!
|
load_date!
|
||||||
|
load_slug!
|
||||||
load_path!
|
load_path!
|
||||||
load_uuid!
|
|
||||||
|
|
||||||
# XXX: No usamos Post#read porque a esta altura todavía no sabemos
|
# XXX: No usamos Post#read porque a esta altura todavía no sabemos
|
||||||
# nada del Document
|
# nada del Document
|
||||||
|
@ -372,18 +372,18 @@ class Post < OpenStruct
|
||||||
required: true)
|
required: true)
|
||||||
end
|
end
|
||||||
|
|
||||||
def load_lang!
|
def load_lang!(lang = nil)
|
||||||
self.lang = MetadataLang.new(document: document, site: site,
|
self.lang = MetadataLang.new(document: document, site: site,
|
||||||
layout: layout, name: :lang,
|
layout: layout, name: :lang,
|
||||||
type: :lang, post: self,
|
type: :lang, post: self,
|
||||||
required: true)
|
value: lang, required: true)
|
||||||
end
|
end
|
||||||
|
|
||||||
def load_uuid!
|
def load_uuid!(uuid = nil)
|
||||||
self.uuid = MetadataUuid.new(document: document, site: site,
|
self.uuid = MetadataUuid.new(document: document, site: site,
|
||||||
layout: layout, name: :uuid,
|
layout: layout, name: :uuid,
|
||||||
type: :uuid, post: self,
|
type: :uuid, post: self,
|
||||||
required: true)
|
value: uuid, required: true)
|
||||||
end
|
end
|
||||||
|
|
||||||
# Ejecuta la acción de guardado en cada atributo
|
# Ejecuta la acción de guardado en cada atributo
|
||||||
|
|
Loading…
Reference in a new issue