Resolve some minor CC issues

This commit is contained in:
Karl Erik Õunapuu 2020-09-02 16:31:26 +03:00
parent e9f28a6d14
commit 3c7756680d
No known key found for this signature in database
GPG key ID: C9DD647298A34764
9 changed files with 11 additions and 15 deletions

View file

@ -20,6 +20,7 @@ module Concerns
def archive
raise 'Contact cannot be archived' unless archivable?
destroy!
end
@ -35,4 +36,4 @@ module Concerns
end
end
end
end
end

View file

@ -240,8 +240,6 @@ class Contact < ApplicationRecord
contacts.id)')
end
private
def registrant_user_company_contacts(registrant_user)
ident = registrant_user.companies.collect(&:registration_number)

View file

@ -11,4 +11,4 @@ class InactiveContacts
yield contact if block_given?
end
end
end
end

View file

@ -1,5 +0,0 @@
class ChangeLogDomainsChildrenTypeToJsonb < ActiveRecord::Migration
def change
change_column :log_domains, :children, 'jsonb USING children::jsonb'
end
end

View file

@ -4848,4 +4848,5 @@ INSERT INTO "schema_migrations" (version) VALUES
('20200807110611'),
('20200811074839'),
('20200812090409'),
('20200812125810');
('20200812125810'),
('20200902131603');

View file

@ -11,4 +11,4 @@ namespace :contacts do
puts "Archived total: #{archived_contacts.count}"
end
end
end

View file

@ -67,7 +67,7 @@ class ArchivableContactTest < ActiveSupport::TestCase
other_contact = contacts(:william)
assert_not_equal other_contact, contact
Domain.update_all(registrant_id: other_contact)
Domain.update_all(registrant_id: other_contact.id)
DomainContact.delete_all
@ -78,4 +78,4 @@ class ArchivableContactTest < ActiveSupport::TestCase
Contact.inactivity_period = 99.years
@contact
end
end
end

View file

@ -267,6 +267,7 @@ class ContactTest < ActiveSupport::TestCase
contact = unlinked_contact
domains(:shop).update_columns(registrant_id: contact.becomes(Registrant))
reload
assert Contact.unlinked.exclude?(contact), 'Contact should be excluded'
end

View file

@ -27,7 +27,7 @@ class ArchiveContactsTaskTest < ActiveSupport::TestCase
other_contact = contacts(:william)
assert_not_equal other_contact, contact
Domain.update_all(registrant_id: other_contact)
Domain.update_all(registrant_id: other_contact.id)
DomainContact.delete_all
@ -43,4 +43,4 @@ class ArchiveContactsTaskTest < ActiveSupport::TestCase
def run_task
Rake::Task['contacts:archive'].execute
end
end
end