mirror of
https://github.com/internetee/registry.git
synced 2025-06-09 22:24:47 +02:00
Add both types of delete procedure to the view/controller
This commit is contained in:
parent
0e1542609e
commit
b9575661eb
3 changed files with 22 additions and 1 deletions
|
@ -5,7 +5,7 @@ module Admin
|
|||
authorize! :manage, domain
|
||||
|
||||
domain.transaction do
|
||||
domain.schedule_force_delete
|
||||
domain.schedule_force_delete(type: force_delete_type)
|
||||
domain.registrar.notifications.create!(text: t('force_delete_set_on_domain',
|
||||
domain_name: domain.name))
|
||||
|
||||
|
@ -35,6 +35,14 @@ module Admin
|
|||
def notify_by_email?
|
||||
ActiveRecord::Type::Boolean.new.cast(params[:notify_by_email])
|
||||
end
|
||||
|
||||
def force_delete_type
|
||||
soft_delete? ? :soft : :fast_track
|
||||
end
|
||||
|
||||
def soft_delete?
|
||||
ActiveRecord::Type::Boolean.new.cast(params[:soft_delete])
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue