Class: LcpRuby::BackgroundJobs::ChangeHandler
- Inherits:
-
Object
- Object
- LcpRuby::BackgroundJobs::ChangeHandler
- Defined in:
- lib/lcp_ruby/background_jobs/change_handler.rb
Class Method Summary collapse
Class Method Details
.install!(model_class) ⇒ Object
4 5 6 7 8 9 10 11 12 13 14 |
# File 'lib/lcp_ruby/background_jobs/change_handler.rb', line 4 def self.install!(model_class) model_class.after_commit do |_record| Registry.reload! adapter = LcpRuby.configuration.schedule_adapter if adapter&.respond_to?(:sync_schedules!) definitions = Registry.all_definitions adapter.sync_schedules!(definitions) end end end |