Allow import/export of instance-level domain blocks/allows (#1754)

* Allow import/export of instance-level domain blocks/allows.
Fixes #15095

* Pacify circleci

* Address simple code review feedback

* Add headers to exported CSV

* Extract common import/export functionality to
AdminExportControllerConcern

* Add additional fields to instance-blocked domain export

* Address review feedback

* Split instance domain block/allow import/export into separate pages/controllers

* Address code review feedback

* Pacify DeepSource

* Work around Paperclip::HasAttachmentFile for Rails 6

* Fix deprecated API warning in export tests

* Remove after_commit workaround
This commit is contained in:
Levi Bard
2022-05-16 09:29:01 +02:00
committed by GitHub
parent dc350be6f5
commit 94e98864e3
16 changed files with 414 additions and 1 deletions

View File

@ -23,6 +23,10 @@ class DomainAllow < ApplicationRecord
!rule_for(domain).nil?
end
def allowed_domains
select(:domain)
end
def rule_for(domain)
return if domain.blank?