mirror of
https://github.com/internetee/registry.git
synced 2025-08-02 16:02:03 +02:00
Merge remote-tracking branch 'origin/master' into 111396946-blocked_and_reserved_view2
# Conflicts: # app/controllers/admin/blocked_domains_controller.rb # app/models/blocked_domain.rb
This commit is contained in:
commit
fd9fca741a
39 changed files with 684 additions and 227 deletions
|
@ -38,11 +38,15 @@ class ReservedDomain < ActiveRecord::Base
|
|||
end
|
||||
|
||||
def generate_data
|
||||
return if Domain.where(name: name).any?
|
||||
|
||||
@json = generate_json
|
||||
@body = generate_body
|
||||
update_whois_server
|
||||
end
|
||||
|
||||
alias_method :update_whois_record, :generate_data
|
||||
|
||||
def update_whois_server
|
||||
wr = Whois::Record.find_or_initialize_by(name: name)
|
||||
wr.body = @body
|
||||
|
@ -63,6 +67,8 @@ class ReservedDomain < ActiveRecord::Base
|
|||
end
|
||||
|
||||
def remove_data
|
||||
return if Domain.where(name: name).any?
|
||||
|
||||
Whois::Record.where(name: name).delete_all
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue