Reject DNS key if public_key is blank

This commit is contained in:
Martin Lensment 2014-10-06 12:36:00 +03:00
parent bb6afc7e87
commit 416128823b

View file

@ -28,7 +28,8 @@ class Domain < ActiveRecord::Base
has_many :domain_transfers, dependent: :delete_all
has_many :dnskeys, dependent: :delete_all
accepts_nested_attributes_for :dnskeys, allow_destroy: true
accepts_nested_attributes_for :dnskeys, allow_destroy: true,
reject_if: proc { |attrs| attrs[:public_key].blank? }
delegate :code, to: :owner_contact, prefix: true
delegate :email, to: :owner_contact, prefix: true