about summary refs log tree commit diff
path: root/app/models/concerns/domain_materializable.rb
blob: 88337f8c00094c9c504d4929224819f2cae739a9 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
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