Class: LcpRuby::Workflow::ChangeHandler

Inherits:
Object
  • Object
show all
Defined in:
lib/lcp_ruby/workflow/change_handler.rb

Class Method Summary collapse

Class Method Details

.install!(model_class) ⇒ Object

Installs after_commit callbacks on the workflow model to invalidate caches.

Parameters:

  • model_class (Class)

    the workflow AR model



6
7
8
9
10
11
# File 'lib/lcp_ruby/workflow/change_handler.rb', line 6

def self.install!(model_class)
  model_class.after_commit do |_record|
    Registry.reload!
    Authorization::PolicyFactory.clear!
  end
end