diff --git a/app/models/post.rb b/app/models/post.rb index 227ef744..a595b024 100644 --- a/app/models/post.rb +++ b/app/models/post.rb @@ -63,11 +63,6 @@ class Post end end - # @return [IndexedPost,nil] - def indexed_post - site.indexed_posts.find_by(locale: lang.value, path: id) - end - # Redefinir el inicializador de OpenStruct # # @param :site [Site] el sitio en Sutty diff --git a/app/models/post/indexable.rb b/app/models/post/indexable.rb index 3aa8ce59..40be9b1c 100644 --- a/app/models/post/indexable.rb +++ b/app/models/post/indexable.rb @@ -10,6 +10,11 @@ class Post after_save :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 # # @return [IndexedPost]