mirror of
https://github.com/internetee/registry.git
synced 2025-05-17 17:59:47 +02:00
Cleaned up unnecessary comments
This commit is contained in:
parent
cfdafe7aac
commit
76e19b7e90
5 changed files with 9 additions and 10 deletions
|
@ -1,4 +1,5 @@
|
|||
class Client::DomainVersionsController < ClientController
|
||||
helper WhodunnitHelper
|
||||
before_action :set_domain, only: [:show]
|
||||
|
||||
def index
|
||||
|
|
|
@ -71,16 +71,15 @@ class Domain < ActiveRecord::Base
|
|||
|
||||
def create_version
|
||||
return true unless PaperTrail.enabled?
|
||||
# We don't create a version unless domain is valid, is that a good idea?
|
||||
return true unless valid?
|
||||
#return true if versions.try(:last).try(:snapshot) == create_snapshot
|
||||
touch_with_version if new_version
|
||||
end
|
||||
|
||||
def track_nameserver_add(nameserver)
|
||||
# if we are not adding nameservers on create ( we don't care about ms so to_i )
|
||||
#return true if versions.try(:last).try(:snapshot) == create_snapshot
|
||||
touch_with_version if nameserver.created_at.to_i != created_at.to_i && valid? && new_version
|
||||
return true unless valid? && new_version
|
||||
ns_created = nameserver.created_at.to_i
|
||||
return true if created_at.to_i.between?( ns_created, ns_created + 1 )
|
||||
touch_with_version
|
||||
end
|
||||
|
||||
def create_snapshot
|
||||
|
|
|
@ -58,6 +58,7 @@
|
|||
%td
|
||||
%p{ :style => 'font-size:x-small;' }
|
||||
= l(version.created_at, format: :short)
|
||||
= version.whodunnit
|
||||
= version.event
|
||||
= whodunnit_with_protocol(version.whodunnit)
|
||||
=# version.whodunnit
|
||||
=# version.event
|
||||
|
||||
|
|
|
@ -51,7 +51,7 @@
|
|||
%li
|
||||
= link_to t('shared.contact_list'), client_contacts_path
|
||||
|
||||
%li.dropdown
|
||||
-# %li.dropdown
|
||||
%a.dropdown-toggle{"data-toggle" => "dropdown", href: "#"}
|
||||
= t('shared.history')
|
||||
%span.caret
|
||||
|
|
|
@ -65,10 +65,8 @@ describe DomainVersion do
|
|||
|
||||
context 'when removing child' do
|
||||
it('has one domain version before events') { expect(DomainVersion.count).to eq(1) }
|
||||
before(:each) { Domain.last.nameservers << Fabricate(:nameserver) }
|
||||
|
||||
it 'contact creates a version' do
|
||||
# FIXME: For some reason nameservers disappeared mid-test, but randomly stopped happening
|
||||
expect(DomainVersion.count).to eq(1)
|
||||
DomainContact.last.destroy
|
||||
expect(Domain.last.valid?).to be(true)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue