5
0
Fork 0
mirror of https://0xacab.org/sutty/sutty synced 2024-11-22 04:26:22 +00:00

WIP de interfaz

This commit is contained in:
f 2020-02-19 19:31:13 -03:00
parent 5392f9a942
commit 44284fd9b8
No known key found for this signature in database
GPG key ID: 2AE5A13E321F953D
2 changed files with 5 additions and 3 deletions

View file

@ -113,6 +113,6 @@ class SitesController < ApplicationController
def site_params def site_params
params.require(:site) params.require(:site)
.permit(:name, :design_id, :licencia_id, :description, :title, .permit(:name, :design_id, :licencia_id, :description, :title,
deploys_attributes: %i[type id _destroy]) deploys_attributes: %i[type id _destroy hostname])
end end
end end

View file

@ -7,7 +7,7 @@ class Site < ApplicationRecord
# TODO: Hacer que los diferentes tipos de deploy se auto registren # TODO: Hacer que los diferentes tipos de deploy se auto registren
# @see app/services/site_service.rb # @see app/services/site_service.rb
DEPLOYS = %i[local www zip].freeze DEPLOYS = %i[local www zip alternative_domain].freeze
validates :name, uniqueness: true, hostname: { validates :name, uniqueness: true, hostname: {
allow_root_label: true allow_root_label: true
@ -335,7 +335,9 @@ class Site < ApplicationRecord
def deploy_local_presence def deploy_local_presence
# Usamos size porque queremos saber la cantidad de deploys sin # Usamos size porque queremos saber la cantidad de deploys sin
# guardar también # guardar también
return if deploys.size.positive? && deploys.map(&:type).include?('DeployLocal') if deploys.size.positive? && deploys.map(&:type).include?('DeployLocal')
return
end
errors.add(:deploys, I18n.t('activerecord.errors.models.site.attributes.deploys.deploy_local_presence')) errors.add(:deploys, I18n.t('activerecord.errors.models.site.attributes.deploys.deploy_local_presence'))
end end