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

feat: eliminar registros en njalla

This commit is contained in:
f 2023-03-31 13:35:42 -03:00
parent d4f5bb60ee
commit db67b9dbf3
3 changed files with 11 additions and 3 deletions

View file

@ -40,7 +40,7 @@ gem 'devise'
gem 'devise-i18n' gem 'devise-i18n'
gem 'devise_invitable' gem 'devise_invitable'
gem 'distributed-press-api-client', '~> 0.2.3' gem 'distributed-press-api-client', '~> 0.2.3'
gem 'njalla-api-client' gem 'njalla-api-client', '~> 0.2.0'
gem 'email_address', git: 'https://github.com/fauno/email_address', branch: 'i18n' gem 'email_address', git: 'https://github.com/fauno/email_address', branch: 'i18n'
gem 'exception_notification' gem 'exception_notification'
gem 'fast_blank' gem 'fast_blank'

View file

@ -387,7 +387,7 @@ GEM
nokogiri (1.12.5-x86_64-linux-musl) nokogiri (1.12.5-x86_64-linux-musl)
mini_portile2 (~> 2.6.1) mini_portile2 (~> 2.6.1)
racc (~> 1.4) racc (~> 1.4)
njalla-api-client (0.1.0) njalla-api-client (0.2.0)
dry-schema dry-schema
httparty (~> 0.18) httparty (~> 0.18)
orm_adapter (0.5.0) orm_adapter (0.5.0)

View file

@ -16,7 +16,7 @@ class DeployDistributedPress < Deploy
store :values, accessors: %i[hostname remote_site_id remote_info], coder: JSON store :values, accessors: %i[hostname remote_site_id remote_info], coder: JSON
before_create :create_remote_site!, :create_njalla_records! before_create :create_remote_site!, :create_njalla_records!
before_destroy :delete_remote_site! before_destroy :delete_remote_site!, :delete_njalla_records!
DEPENDENCIES = %i[deploy_local] DEPENDENCIES = %i[deploy_local]
@ -165,6 +165,14 @@ class DeployDistributedPress < Deploy
nil nil
end end
def delete_njalla_records!
%[a ns cname].each do |type|
next unless (id = remote_info.dig('njalla', type, 'id'))
njalla.remove_record(id: id)
end
end
# Actualizar registros en Njalla # Actualizar registros en Njalla
# #
# @return [Njalla::V1::Domain] # @return [Njalla::V1::Domain]