mirror of
https://github.com/internetee/registry.git
synced 2025-08-02 07:52:04 +02:00
Show only priv contacts
This commit is contained in:
parent
e20de5b793
commit
2ed9672eb5
8 changed files with 28 additions and 3 deletions
|
@ -69,6 +69,10 @@ class Contact < ActiveRecord::Base
|
|||
count = find_orphans.destroy_all.count
|
||||
logger.info "#{Time.zone.now.utc} - Successfully destroyed #{count} orphaned contacts\n"
|
||||
end
|
||||
|
||||
def privs
|
||||
where("ident_type = '#{PRIV}'")
|
||||
end
|
||||
end
|
||||
|
||||
def to_s
|
||||
|
|
|
@ -9,6 +9,7 @@ class Registrar < ActiveRecord::Base
|
|||
has_many :accounts
|
||||
has_many :nameservers, through: :domains
|
||||
has_many :whois_records
|
||||
has_many :priv_contacts, -> { privs }, class_name: 'Contact'
|
||||
|
||||
validates :name, :reg_no, :country_code, :email, :code, presence: true
|
||||
validates :name, :reg_no, :reference_no, :code, uniqueness: true
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue