5
0
Fork 0
mirror of https://0xacab.org/sutty/sutty synced 2024-11-15 12:51:42 +00:00

feat: encontrar el post a partir de su indexación

This commit is contained in:
f 2023-04-25 14:51:54 -03:00
parent 9e78a2df1d
commit e9d33b625a

View file

@ -36,6 +36,15 @@ class IndexedPost < ApplicationRecord
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
#
# @param [String,Symbol]