Pump minitest version

This commit is contained in:
Alex Sherman 2020-01-30 13:55:08 +05:00
parent c7593338e2
commit 4e1bec3613
7 changed files with 12 additions and 105 deletions

View file

@ -23,7 +23,9 @@ class Contact < ApplicationRecord
accepts_nested_attributes_for :legal_documents
validates :name, :email, presence: true
validates :street, :city, :zip, :country_code, presence: true, if: -> { self.class.address_processing? }
validates :street, :city, :zip, :country_code, presence: true, if: lambda {
self.class.address_processing?
}
validates :phone, presence: true, e164: true, phone: true

View file

@ -9,15 +9,16 @@ class Dnskey < ApplicationRecord
validate :validate_protocol
validate :validate_flags
before_save -> { generate_digest if will_save_change_to_public_key? &&
!will_save_change_to_ds_digest? }
before_save lambda {
generate_digest if will_save_change_to_public_key? && !will_save_change_to_ds_digest?
}
before_save lambda {
if (will_save_change_to_public_key? ||
will_save_change_to_flags? ||
will_save_change_to_alg? ||
will_save_change_to_protocol?) &&
!will_save_change_to_ds_key_tag?
!will_save_change_to_ds_key_tag?
generate_ds_key_tag
end
}

View file

@ -74,11 +74,12 @@ class Domain < ApplicationRecord
before_update :manage_statuses
def manage_statuses
return unless will_save_change_to_registrant_id? # rollback has not yet happened
pending_update! if registrant_verification_asked?
true
end
after_commit :update_whois_record, unless: 'domain_name.at_auction?'
after_commit :update_whois_record, unless: -> { domain_name.at_auction? }
after_create :update_reserved_domains
def update_reserved_domains