5
0
Fork 0
mirror of https://0xacab.org/sutty/sutty synced 2024-11-18 11:36:21 +00:00

feat: soportar varias instancias de distributed press #14540

This commit is contained in:
f 2023-11-01 17:02:32 -03:00
parent b96363a59f
commit b67193fbca
No known key found for this signature in database
2 changed files with 20 additions and 4 deletions

View file

@ -101,12 +101,14 @@ class DeployDistributedPress < Deploy
# El cliente de la API # El cliente de la API
# #
# TODO: cuando soportemos más, tiene que haber una relación entre
# DeployDistributedPress y DistributedPressPublisher.
#
# @return [DistributedPressPublisher] # @return [DistributedPressPublisher]
def publisher def publisher
@publisher ||= DistributedPressPublisher.last @publisher ||=
if distributed_press_publisher_id
DistributedPressPublisher.find(distributed_press_publisher_id)
else
DistributedPressPublisher.find_by_default(true)
end
end end
# El cliente para actualizar el sitio # El cliente para actualizar el sitio

View file

@ -0,0 +1,14 @@
# frozen_string_literal: true
# Una instancia es la instancia por defecto
class AddDefaultToDistributedPressPublisher < ActiveRecord::Migration[6.1]
def up
add_column :distributed_press_publishers, :default, :boolean, default: false
DistributedPressPublisher.last.update(default: true)
end
def down
remove_column :distributed_press_publishers, :default
end
end