Added pure PaperTrail stack

This commit is contained in:
Priit Tark 2015-01-28 17:26:26 +02:00
parent ea6bdc19f9
commit 09a816d5a8
27 changed files with 846 additions and 492 deletions

View file

@ -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