From d896a111b8128ff24be33b6233f8c85bd5ffdd0a Mon Sep 17 00:00:00 2001 From: f Date: Fri, 30 Dec 2022 10:55:10 -0300 Subject: [PATCH] fix: no cargar el sitio hasta que no se usen los posts --- app/models/site.rb | 6 +++++- app/views/sites/index.haml | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/app/models/site.rb b/app/models/site.rb index dfc4f034..ac290403 100644 --- a/app/models/site.rb +++ b/app/models/site.rb @@ -333,6 +333,10 @@ class Site < ApplicationRecord status == 'building' end + def jekyll? + File.directory? path + end + def jekyll run_in_path do @jekyll ||= @@ -432,7 +436,7 @@ class Site < ApplicationRecord # Clona el esqueleto de Sutty para crear el sitio nuevo, no pasa nada # si el sitio ya existe def clone_skel! - return if File.directory? path + return if jekyll? Rugged::Repository.clone_at ENV['SKEL_SUTTY'], path end diff --git a/app/views/sites/index.haml b/app/views/sites/index.haml index d69dbeac..56178775 100644 --- a/app/views/sites/index.haml +++ b/app/views/sites/index.haml @@ -14,7 +14,7 @@ %table.table.table-condensed %tbody - @sites.each do |site| - - next unless site.jekyll + - next unless site.jekyll? - rol = current_usuarie.rol_for_site(site) -# TODO: Solo les usuaries cachean porque tenemos que separar