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
|
class Client::DomainVersionsController < ClientController
|
||||||
|
helper WhodunnitHelper
|
||||||
before_action :set_domain, only: [:show]
|
before_action :set_domain, only: [:show]
|
||||||
|
|
||||||
def index
|
def index
|
||||||
|
|
|
@ -71,16 +71,15 @@ class Domain < ActiveRecord::Base
|
||||||
|
|
||||||
def create_version
|
def create_version
|
||||||
return true unless PaperTrail.enabled?
|
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 unless valid?
|
||||||
#return true if versions.try(:last).try(:snapshot) == create_snapshot
|
|
||||||
touch_with_version if new_version
|
touch_with_version if new_version
|
||||||
end
|
end
|
||||||
|
|
||||||
def track_nameserver_add(nameserver)
|
def track_nameserver_add(nameserver)
|
||||||
# if we are not adding nameservers on create ( we don't care about ms so to_i )
|
return true unless valid? && new_version
|
||||||
#return true if versions.try(:last).try(:snapshot) == create_snapshot
|
ns_created = nameserver.created_at.to_i
|
||||||
touch_with_version if nameserver.created_at.to_i != created_at.to_i && valid? && new_version
|
return true if created_at.to_i.between?( ns_created, ns_created + 1 )
|
||||||
|
touch_with_version
|
||||||
end
|
end
|
||||||
|
|
||||||
def create_snapshot
|
def create_snapshot
|
||||||
|
|
|
@ -58,6 +58,7 @@
|
||||||
%td
|
%td
|
||||||
%p{ :style => 'font-size:x-small;' }
|
%p{ :style => 'font-size:x-small;' }
|
||||||
= l(version.created_at, format: :short)
|
= l(version.created_at, format: :short)
|
||||||
= version.whodunnit
|
= whodunnit_with_protocol(version.whodunnit)
|
||||||
= version.event
|
=# version.whodunnit
|
||||||
|
=# version.event
|
||||||
|
|
||||||
|
|
|
@ -51,7 +51,7 @@
|
||||||
%li
|
%li
|
||||||
= link_to t('shared.contact_list'), client_contacts_path
|
= link_to t('shared.contact_list'), client_contacts_path
|
||||||
|
|
||||||
%li.dropdown
|
-# %li.dropdown
|
||||||
%a.dropdown-toggle{"data-toggle" => "dropdown", href: "#"}
|
%a.dropdown-toggle{"data-toggle" => "dropdown", href: "#"}
|
||||||
= t('shared.history')
|
= t('shared.history')
|
||||||
%span.caret
|
%span.caret
|
||||||
|
|
|
@ -65,10 +65,8 @@ describe DomainVersion do
|
||||||
|
|
||||||
context 'when removing child' do
|
context 'when removing child' do
|
||||||
it('has one domain version before events') { expect(DomainVersion.count).to eq(1) }
|
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
|
it 'contact creates a version' do
|
||||||
# FIXME: For some reason nameservers disappeared mid-test, but randomly stopped happening
|
|
||||||
expect(DomainVersion.count).to eq(1)
|
expect(DomainVersion.count).to eq(1)
|
||||||
DomainContact.last.destroy
|
DomainContact.last.destroy
|
||||||
expect(Domain.last.valid?).to be(true)
|
expect(Domain.last.valid?).to be(true)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue