mirror of
https://github.com/internetee/registry.git
synced 2025-08-05 17:28:18 +02:00
Added pure PaperTrail stack
This commit is contained in:
parent
ea6bdc19f9
commit
09a816d5a8
27 changed files with 846 additions and 492 deletions
|
@ -3,8 +3,9 @@ class DomainContact < ActiveRecord::Base
|
|||
belongs_to :contact
|
||||
belongs_to :domain
|
||||
|
||||
after_create :domain_snapshot
|
||||
after_destroy :domain_snapshot
|
||||
# TODO: remove old
|
||||
# after_create :domain_snapshot
|
||||
# after_destroy :domain_snapshot
|
||||
# after_save :domain_snapshot
|
||||
|
||||
attr_accessor :value_typeahead
|
||||
|
@ -38,10 +39,11 @@ class DomainContact < ActiveRecord::Base
|
|||
@value_typeahead || contact.try(:name) || nil
|
||||
end
|
||||
|
||||
def domain_snapshot
|
||||
return true if domain.nil?
|
||||
return true if domain.versions.count == 0 # avoid snapshot on creation
|
||||
domain.create_version
|
||||
true
|
||||
end
|
||||
# TODO: remove old
|
||||
# def domain_snapshot
|
||||
# return true if domain.nil?
|
||||
# return true if domain.versions.count == 0 # avoid snapshot on creation
|
||||
# domain.create_version
|
||||
# true
|
||||
# end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue