This commit is contained in:
f 2019-09-12 15:10:37 -03:00
parent 53d7e74e31
commit 55a3978a40
No known key found for this signature in database
GPG key ID: 2AE5A13E321F953D
2 changed files with 9 additions and 2 deletions

View file

@ -41,6 +41,13 @@ class SitesController < ApplicationController
def edit def edit
@site = find_site @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 authorize @site
end end
@ -51,7 +58,7 @@ class SitesController < ApplicationController
service = SiteService.new(site: @site, params: site_params, service = SiteService.new(site: @site, params: site_params,
usuarie: current_usuarie) usuarie: current_usuarie)
if service.update if service.update.valid?
redirect_to sites_path redirect_to sites_path
else else
render 'edit' render 'edit'

View file

@ -81,7 +81,7 @@ class Site
# Hay commits sin aplicar? # Hay commits sin aplicar?
def needs_pull? def needs_pull?
commits.empty? !commits.empty?
end end
# Guarda los cambios en git, de a un archivo por vez # Guarda los cambios en git, de a un archivo por vez