From 55a3978a402c3d212b576db1ca0b9673ebeb7883 Mon Sep 17 00:00:00 2001 From: f Date: Thu, 12 Sep 2019 15:10:37 -0300 Subject: [PATCH] fixes --- app/controllers/sites_controller.rb | 9 ++++++++- app/models/site/repository.rb | 2 +- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/app/controllers/sites_controller.rb b/app/controllers/sites_controller.rb index e0453e81..f9053f09 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 825cc84a..ec600a61 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