mirror of
https://github.com/internetee/registry.git
synced 2025-08-04 17:01:44 +02:00
DomainContact versioning and tests for versioning
This commit is contained in:
parent
79bf0e54c3
commit
cb37ddf96d
3 changed files with 63 additions and 1 deletions
|
@ -3,6 +3,10 @@ class DomainContact < ActiveRecord::Base
|
|||
belongs_to :contact
|
||||
belongs_to :domain
|
||||
|
||||
after_create :domain_snapshot
|
||||
after_destroy :domain_snapshot
|
||||
# after_save :domain_snapshot
|
||||
|
||||
attr_accessor :value_typeahead
|
||||
|
||||
def epp_code_map
|
||||
|
@ -33,4 +37,11 @@ class DomainContact < ActiveRecord::Base
|
|||
def value_typeahead
|
||||
@value_typeahead || contact.try(:name) || nil
|
||||
end
|
||||
|
||||
def domain_snapshot
|
||||
# We don't create a version unless domain is valid, is that a good idea?
|
||||
return true unless PaperTrail.enabled?
|
||||
domain.touch_with_version if domain.valid?
|
||||
true
|
||||
end
|
||||
end
|
||||
|
|
|
@ -55,5 +55,9 @@
|
|||
= ns[:hostname] + ","
|
||||
= ns[:ipv4] || ns[:ipv6]
|
||||
|
||||
%td= l(version.created_at, format: :short)
|
||||
%td
|
||||
%p{ :style => 'font-size:x-small;' }
|
||||
= l(version.created_at, format: :short)
|
||||
= version.whodunnit
|
||||
= version.event
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue