From 58077a7989e861cc3ae7054ecdccc22c3334892e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andres=20Keskk=C3=BCla?= Date: Thu, 16 Oct 2014 12:01:34 +0300 Subject: [PATCH] Style fixes --- app/models/domain.rb | 26 -------------------------- app/models/domain_contact.rb | 2 +- spec/models/domain_version_spec.rb | 4 ++-- 3 files changed, 3 insertions(+), 29 deletions(-) diff --git a/app/models/domain.rb b/app/models/domain.rb index 8afe86671..43f0629bf 100644 --- a/app/models/domain.rb +++ b/app/models/domain.rb @@ -62,9 +62,6 @@ class Domain < ActiveRecord::Base # archiving has_paper_trail class_name: 'DomainVersion', meta: { snapshot: :create_snapshot } - # TODO Add touch_with_version hook to the DomainContact as well to track add/delete(?) of contact - # Not sure what hook to use since Contact.destroy fires update from here so possibly after_create - def create_snapshot oc = owner_contact.snapshot if owner_contact.is_a?(Contact) { @@ -290,27 +287,4 @@ class Domain < ActiveRecord::Base return period.to_i.years if unit == 'y' end end - - private - - # for archiving - # def version_owner - # return nil unless owner_contact - # owner_contact.id - # end - - # def version_admin_contacts - # return nil unless admin_contacts - # return admin_contacts.map { |ns| ns.id } - # end - - # def version_tech_contacts - # return nil unless tech_contacts - # return tech_contacts.map { |ns| ns.id } - # end - - # def version_nameservers - # return nil unless nameservers - # return nameservers.map { |ns| ns.id } - # end end diff --git a/app/models/domain_contact.rb b/app/models/domain_contact.rb index 479ab5890..472496d79 100644 --- a/app/models/domain_contact.rb +++ b/app/models/domain_contact.rb @@ -5,7 +5,7 @@ class DomainContact < ActiveRecord::Base after_create :domain_snapshot after_destroy :domain_snapshot -# after_save :domain_snapshot + # after_save :domain_snapshot attr_accessor :value_typeahead diff --git a/spec/models/domain_version_spec.rb b/spec/models/domain_version_spec.rb index 5f7c782c3..270f60a4c 100644 --- a/spec/models/domain_version_spec.rb +++ b/spec/models/domain_version_spec.rb @@ -64,11 +64,11 @@ describe DomainVersion do end 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 - # FIXME For some reason nameservers disappeared mid-test, but randomly stopped happening + # 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)