mirror of
https://github.com/internetee/registry.git
synced 2025-06-09 06:04:56 +02:00
Merge pull request #1609 from internetee/1604-updating-whois-after-contact-update
Fix not running whois update after contact update
This commit is contained in:
commit
5e492afdba
3 changed files with 12 additions and 2 deletions
|
@ -504,7 +504,8 @@ class Contact < ApplicationRecord
|
||||||
|
|
||||||
def update_related_whois_records
|
def update_related_whois_records
|
||||||
# not doing anything if no real changes
|
# not doing anything if no real changes
|
||||||
return if changes.slice(*(self.class.column_names - ["updated_at", "created_at", "statuses", "status_notes"])).empty?
|
ignored_columns = %w[updated_at created_at statuses status_notes]
|
||||||
|
return if saved_changes.slice(*(self.class.column_names - ignored_columns)).empty?
|
||||||
|
|
||||||
names = related_domain_descriptions.keys
|
names = related_domain_descriptions.keys
|
||||||
UpdateWhoisRecordJob.enqueue(names, 'domain') if names.present?
|
UpdateWhoisRecordJob.enqueue(names, 'domain') if names.present?
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
|
|
||||||
Rails.application.configure do
|
Rails.application.configure do
|
||||||
$VERBOSE = nil
|
# $VERBOSE = nil
|
||||||
# Settings specified here will take precedence over those in config/application.rb.
|
# Settings specified here will take precedence over those in config/application.rb.
|
||||||
|
|
||||||
# The test environment is used exclusively to run your application's
|
# The test environment is used exclusively to run your application's
|
||||||
|
|
|
@ -248,6 +248,15 @@ class ContactTest < ActiveSupport::TestCase
|
||||||
assert_equal %w[ok], contact.statuses
|
assert_equal %w[ok], contact.statuses
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def test_whois_gets_updated_after_contact_save
|
||||||
|
@contact.name = 'SomeReallyWeirdRandomTestName'
|
||||||
|
domain = @contact.registrant_domains.first
|
||||||
|
|
||||||
|
@contact.save!
|
||||||
|
|
||||||
|
assert_equal domain.whois_record.try(:json).try(:[], 'registrant'), @contact.name
|
||||||
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
def make_contact_free_of_domains_where_it_acts_as_a_registrant(contact)
|
def make_contact_free_of_domains_where_it_acts_as_a_registrant(contact)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue