Fix performance on instances list in admin UI (#15282)
- Reduce duplicate queries - Remove n+1 queries - Add accounts count to detailed view - Add separate action log entry for updating existing domain blocks
This commit is contained in:
parent
a3b5675aa8
commit
216b85b053
27 changed files with 331 additions and 171 deletions
13
app/models/concerns/domain_materializable.rb
Normal file
13
app/models/concerns/domain_materializable.rb
Normal file
|
@ -0,0 +1,13 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module DomainMaterializable
|
||||
extend ActiveSupport::Concern
|
||||
|
||||
included do
|
||||
after_create_commit :refresh_instances_view
|
||||
end
|
||||
|
||||
def refresh_instances_view
|
||||
Instance.refresh unless domain.nil? || Instance.where(domain: domain).exists?
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue