Class: ActiveRecord::Materialized::RefreshJob

Inherits:
ActiveJob::Base
  • Object
show all
Extended by:
T::Sig
Defined in:
lib/activerecord/materialized/refresh_job.rb

Overview

ActiveJob wrapper that runs a view’s incremental refresh on a background worker.

Instance Method Summary collapse

Instance Method Details

#perform(view_key) ⇒ Object



13
14
15
16
17
18
19
# File 'lib/activerecord/materialized/refresh_job.rb', line 13

def perform(view_key)
  view_class = Registry.find(view_key)
  return if view_class.nil?
  return unless view_class.dirty?

  view_class.refresh!
end