mirror of
https://github.com/internetee/registry.git
synced 2025-07-22 18:56:05 +02:00
Registrant: Only show domains that user is connected with personally / via company
This commit is contained in:
parent
7b6060b4fb
commit
4f9fa88bd4
2 changed files with 9 additions and 6 deletions
|
@ -210,10 +210,13 @@ class Contact < ApplicationRecord
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
|
||||||
def registrant_user_contacts(registrant_user)
|
def registrant_user_contacts(registrant_user, representment: true)
|
||||||
registrant_user_direct_contacts(registrant_user)
|
represented_contacts = registrant_user_direct_contacts(registrant_user)
|
||||||
.or(registrant_user_company_contacts(registrant_user))
|
.or(registrant_user_company_contacts(registrant_user))
|
||||||
.or(registrant_user_indirect_contacts(registrant_user))
|
|
||||||
|
return represented_contacts if representment
|
||||||
|
|
||||||
|
represented_contacts.or(registrant_user_indirect_contacts(registrant_user))
|
||||||
end
|
end
|
||||||
|
|
||||||
def registrant_user_direct_contacts(registrant_user)
|
def registrant_user_direct_contacts(registrant_user)
|
||||||
|
|
|
@ -22,8 +22,8 @@ class RegistrantUser < User
|
||||||
citizen_country_code: country.alpha3)
|
citizen_country_code: country.alpha3)
|
||||||
end
|
end
|
||||||
|
|
||||||
def contacts
|
def contacts(representment: true)
|
||||||
Contact.registrant_user_contacts(self)
|
Contact.registrant_user_contacts(self, representment: representment)
|
||||||
end
|
end
|
||||||
|
|
||||||
def direct_contacts
|
def direct_contacts
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue