diff --git a/app/controllers/sites_controller.rb b/app/controllers/sites_controller.rb index e0453e8..f9053f0 100644 --- a/app/controllers/sites_controller.rb +++ b/app/controllers/sites_controller.rb @@ -41,6 +41,13 @@ class SitesController < ApplicationController def edit @site = find_site + + # TODO: esto está acá para ayudar en la migración de + if @site.deploys.empty? + @site.deploys.build(type: 'DeployLocal') + @site.deploys.build type: 'DeployZip' + end + authorize @site end @@ -51,7 +58,7 @@ class SitesController < ApplicationController service = SiteService.new(site: @site, params: site_params, usuarie: current_usuarie) - if service.update + if service.update.valid? redirect_to sites_path else render 'edit' diff --git a/app/models/site/repository.rb b/app/models/site/repository.rb index 825cc84..ec600a6 100644 --- a/app/models/site/repository.rb +++ b/app/models/site/repository.rb @@ -81,7 +81,7 @@ class Site # Hay commits sin aplicar? def needs_pull? - commits.empty? + !commits.empty? end # Guarda los cambios en git, de a un archivo por vez