From 7b4ffb0b3dddf472e0f1489f302cea0bb9c5f71b Mon Sep 17 00:00:00 2001 From: f Date: Sat, 12 Sep 2020 12:29:43 -0300 Subject: [PATCH] arreglar semillas --- app/models/site.rb | 8 +++++++- db/seeds.rb | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/app/models/site.rb b/app/models/site.rb index c99bc145..d806863a 100644 --- a/app/models/site.rb +++ b/app/models/site.rb @@ -458,7 +458,13 @@ class Site < ApplicationRecord return unless design_id_changed? new_configuration = configuration.dup - new_configuration['theme'] = design.gem + + if design.no_theme? + new_configuration['theme'] = design.gem + else + new_configuration.delete 'theme' + end + new_site = Jekyll::Site.new(new_configuration) new_site.read new_site.documents.map(&:read!) diff --git a/db/seeds.rb b/db/seeds.rb index 01b0afef..214bbcb0 100644 --- a/db/seeds.rb +++ b/db/seeds.rb @@ -22,6 +22,6 @@ unless Rails.env.test? site.update licencia: Licencia.first, design: Design.first, title: site.name, description: 'x' * 50, - deploys: [DeployLocal.new] + deploys: site.deploys.empty? ? [DeployLocal.new] : site.deploys end end