Merge branch 'story/105664240-whois-updater' into staging

This commit is contained in:
Vladimir Krylov 2015-10-28 08:35:35 +02:00
commit 242c6b2f5c
4 changed files with 28 additions and 4 deletions

View file

@ -51,10 +51,10 @@ class Registrar < ActiveRecord::Base
WHOIS_TRIGGERS = %w(name email phone street city state zip)
after_save :update_whois_records
after_commit :update_whois_records
def update_whois_records
return true unless changed? && (changes.keys & WHOIS_TRIGGERS).present?
whois_records.map(&:save) # slow currently
RegenerateRegistrarWhoisesJob.enqueue id
end
after_create :create_cash_account