mirror of
https://0xacab.org/sutty/sutty
synced 2024-11-23 01:16:21 +00:00
fix: obtener el post indexado a partir del post
This commit is contained in:
parent
e34392e77c
commit
3b656f1908
2 changed files with 5 additions and 5 deletions
|
@ -63,11 +63,6 @@ class Post
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
# @return [IndexedPost,nil]
|
|
||||||
def indexed_post
|
|
||||||
site.indexed_posts.find_by(locale: lang.value, path: id)
|
|
||||||
end
|
|
||||||
|
|
||||||
# Redefinir el inicializador de OpenStruct
|
# Redefinir el inicializador de OpenStruct
|
||||||
#
|
#
|
||||||
# @param :site [Site] el sitio en Sutty
|
# @param :site [Site] el sitio en Sutty
|
||||||
|
|
|
@ -10,6 +10,11 @@ class Post
|
||||||
after_save :index!
|
after_save :index!
|
||||||
after_destroy :remove_from_index!
|
after_destroy :remove_from_index!
|
||||||
|
|
||||||
|
# @return [IndexedPost,nil]
|
||||||
|
def indexed_post
|
||||||
|
site.indexed_posts.find_by_post_id(uuid.value)
|
||||||
|
end
|
||||||
|
|
||||||
# Devuelve una versión indexable del Post
|
# Devuelve una versión indexable del Post
|
||||||
#
|
#
|
||||||
# @return [IndexedPost]
|
# @return [IndexedPost]
|
||||||
|
|
Loading…
Reference in a new issue