5
0
Fork 0
mirror of https://0xacab.org/sutty/sutty synced 2024-06-02 07:24:17 +00:00

fix: asegurarse que las gemas están instaladas

This commit is contained in:
f 2022-12-27 18:41:36 -03:00
parent 47f1a8e530
commit e258e6e2d9

View file

@ -56,8 +56,8 @@ class Site < ApplicationRecord
before_destroy :remove_directories!
# Carga el sitio Jekyll una vez que se inicializa el modelo o después
# de crearlo
after_initialize :load_jekyll
after_create :load_jekyll
after_initialize :install_gems, :load_jekyll
after_create :install_gems, :load_jekyll
# Cambiar el nombre del directorio
before_update :update_name!
before_save :add_private_key_if_missing!
@ -515,4 +515,11 @@ class Site < ApplicationRecord
def run_in_path(&block)
Dir.chdir path, &block
end
def install_gems
return unless persisted?
return if Rails.root.join('_storage', 'gems', name).directory?
deploys.find_by_type('DeployLocal').send(:bundle)
end
end