diff --git a/app/models/post.rb b/app/models/post.rb index fff9e17f..ab91bd43 100644 --- a/app/models/post.rb +++ b/app/models/post.rb @@ -54,6 +54,11 @@ 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 @@ -307,8 +312,6 @@ class Post def destroy run_callbacks :destroy do FileUtils.rm_f path.absolute - - site.delete_post self end end alias destroy! destroy