mirror of
https://github.com/internetee/registry.git
synced 2025-08-03 08:22:05 +02:00
Basic history display for eedirekt users
This commit is contained in:
parent
b5608c1394
commit
a426862aa8
6 changed files with 104 additions and 15 deletions
|
@ -3,4 +3,30 @@ class ContactVersion < PaperTrail::Version
|
|||
|
||||
self.table_name = :contact_versions
|
||||
self.sequence_name = :contact_version_id_seq
|
||||
|
||||
class << self
|
||||
|
||||
def registrar_events(id)
|
||||
registrar = Registrar.find(id)
|
||||
@events = []
|
||||
registrar.users.each { |user| @events << user_contacts(user.id) }
|
||||
registrar.epp_users.each { |user| @events << user_contacts(user.id) }
|
||||
@events
|
||||
end
|
||||
|
||||
def user_events(id, epp_user_id=nil)
|
||||
contacts = []
|
||||
contacts << user_contacts(id)
|
||||
contacts << epp_user_contacts(epp_user_id) if epp_user_id
|
||||
contacts
|
||||
end
|
||||
|
||||
def user_contacts(id)
|
||||
where(whodunnit: id.to_s)
|
||||
end
|
||||
|
||||
def epp_user_contacts(id)
|
||||
where(whodunnit: "#{id}-EppUser")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue