mirror of
https://0xacab.org/sutty/sutty
synced 2024-11-21 22:56:22 +00:00
WIP de interfaz
This commit is contained in:
parent
5392f9a942
commit
44284fd9b8
2 changed files with 5 additions and 3 deletions
|
@ -113,6 +113,6 @@ class SitesController < ApplicationController
|
|||
def site_params
|
||||
params.require(:site)
|
||||
.permit(:name, :design_id, :licencia_id, :description, :title,
|
||||
deploys_attributes: %i[type id _destroy])
|
||||
deploys_attributes: %i[type id _destroy hostname])
|
||||
end
|
||||
end
|
||||
|
|
|
@ -7,7 +7,7 @@ class Site < ApplicationRecord
|
|||
|
||||
# TODO: Hacer que los diferentes tipos de deploy se auto registren
|
||||
# @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: {
|
||||
allow_root_label: true
|
||||
|
@ -335,7 +335,9 @@ class Site < ApplicationRecord
|
|||
def deploy_local_presence
|
||||
# Usamos size porque queremos saber la cantidad de deploys sin
|
||||
# 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'))
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue