Prevent resgistrar deleting when children exist

This commit is contained in:
Martin Lensment 2014-10-06 17:57:17 +03:00
parent 79bfa3049e
commit 6f874ecb2a

View file

@ -1,9 +1,8 @@
class Registrar < ActiveRecord::Base
belongs_to :country
has_many :domains, :dependent => :restrict_with_error
has_many :ns_sets
has_many :epp_users
has_many :users
has_many :epp_users, :dependent => :restrict_with_error
has_many :users, :dependent => :restrict_with_error
validates :name, :reg_no, :address, :country, presence: true
validates :name, :reg_no, uniqueness: true