summaryrefslogtreecommitdiff
path: root/app/models/concerns/reactive_service.rb
blob: c444f238944f622e56173afee48216bedf911dae (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
# frozen_string_literal: true

module ReactiveService
  extend ActiveSupport::Concern

  included do
    include ReactiveCaching

    # Default cache key: class name + project_id
    self.reactive_cache_key = ->(service) { [service.class.model_name.singular, service.project_id] }
    self.reactive_cache_work_type = :external_dependency
  end
end