mirror of
https://0xacab.org/sutty/sutty
synced 2024-11-18 09:26:21 +00:00
feat: soportar varias instancias de distributed press #14540
This commit is contained in:
parent
b96363a59f
commit
b67193fbca
2 changed files with 20 additions and 4 deletions
|
@ -101,12 +101,14 @@ class DeployDistributedPress < Deploy
|
|||
|
||||
# El cliente de la API
|
||||
#
|
||||
# TODO: cuando soportemos más, tiene que haber una relación entre
|
||||
# DeployDistributedPress y DistributedPressPublisher.
|
||||
#
|
||||
# @return [DistributedPressPublisher]
|
||||
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
|
||||
|
||||
# El cliente para actualizar el sitio
|
||||
|
|
|
@ -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
|
Loading…
Reference in a new issue