diff --git a/app/models/site.rb b/app/models/site.rb index eb637dc9..c6a57830 100644 --- a/app/models/site.rb +++ b/app/models/site.rb @@ -212,10 +212,8 @@ class Site < ApplicationRecord # Trae los datos del directorio _data dentro del sitio def data unless jekyll.data.present? - run_in_path do - jekyll.reader.read_data - jekyll.data['layouts'] ||= {} - end + jekyll.reader.read_data + jekyll.data['layouts'] ||= {} end jekyll.data @@ -225,9 +223,7 @@ class Site < ApplicationRecord # colecciones. def collections unless @read - run_in_path do - jekyll.reader.read_collections - end + jekyll.reader.read_collections @read = true end @@ -322,9 +318,7 @@ class Site < ApplicationRecord # # @return [Hash] def theme_layouts - run_in_path do - jekyll.reader.read_layouts - end + jekyll.reader.read_layouts end # Trae todos los valores disponibles para un campo @@ -550,10 +544,6 @@ class Site < ApplicationRecord I18n.t('activerecord.errors.models.site.attributes.design_id.layout_incompatible.error')) end - def run_in_path(&block) - Dir.chdir path, &block - end - # Instala las gemas cuando es necesario: # # * El sitio existe