mirror of
https://0xacab.org/sutty/sutty
synced 2025-01-19 05:13:39 +00:00
feat: encontrar el post a partir de su indexación
This commit is contained in:
parent
9e78a2df1d
commit
e9d33b625a
1 changed files with 9 additions and 0 deletions
|
@ -36,6 +36,15 @@ class IndexedPost < ApplicationRecord
|
||||||
|
|
||||||
belongs_to :site
|
belongs_to :site
|
||||||
|
|
||||||
|
# Encuentra el post original
|
||||||
|
#
|
||||||
|
# @return [nil,Post]
|
||||||
|
def post
|
||||||
|
return if post_id.blank?
|
||||||
|
|
||||||
|
@post ||= site.posts(lang: locale).find(post_id, uuid: true)
|
||||||
|
end
|
||||||
|
|
||||||
# Convertir locale a direccionario de PG
|
# Convertir locale a direccionario de PG
|
||||||
#
|
#
|
||||||
# @param [String,Symbol]
|
# @param [String,Symbol]
|
||||||
|
|
Loading…
Reference in a new issue