From d4f85da0188ba77c483f943f8558cd409e399a51 Mon Sep 17 00:00:00 2001 From: f Date: Fri, 6 Oct 2023 10:15:57 -0300 Subject: [PATCH] feat: detectar si un post existe en disco --- app/models/indexed_post.rb | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/app/models/indexed_post.rb b/app/models/indexed_post.rb index ef239a7d..02679ec0 100644 --- a/app/models/indexed_post.rb +++ b/app/models/indexed_post.rb @@ -87,6 +87,13 @@ class IndexedPost < ApplicationRecord site.layouts[layout.to_sym] end + # Existe físicamente? + # + # @return [Boolean] + def exist? + File.exist?(full_path) + end + # Convertir locale a direccionario de PG # # @param [String,Symbol]