Sha256: 274807d1e4a6791478388b0721f3423f40e08add0ef9cbe5feb1dfd50f7e4bd4

Contents?: true

Size: 848 Bytes

Versions: 9

Compression:

Stored size: 848 Bytes

Contents

module OscMacheteRails
  class Engine < ::Rails::Engine
    isolate_namespace OscMacheteRails

    config.app_generators do |g|
      g.workflow_model      true
      g.job_model           true
      g.workflow_template   true
    end

    config.before_initialize do
      OscMacheteRails.update_status_of_all_active_jobs_on_each_request = true
    end

    config.after_initialize do
      if OscMacheteRails.update_status_of_all_active_jobs_on_each_request
        # set before action on both Engine controllers and main App controllers
        # to update the status of all the active jobs
        ::ApplicationController.before_action -> { OscMacheteRails::Statusable.update_status_of_all_active_jobs }
        ApplicationController.before_action -> { OscMacheteRails::Statusable.update_status_of_all_active_jobs }
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
osc_machete_rails-2.1.2 lib/osc_machete_rails/engine.rb
osc_machete_rails-2.1.0 lib/osc_machete_rails/engine.rb
osc_machete_rails-2.0.0 lib/osc_machete_rails/engine.rb
osc_machete_rails-1.3.1 lib/osc_machete_rails/engine.rb
osc_machete_rails-1.3.0 lib/osc_machete_rails/engine.rb
osc_machete_rails-1.2.2 lib/osc_machete_rails/engine.rb
osc_machete_rails-2.0.0.pre1 lib/osc_machete_rails/engine.rb
osc_machete_rails-1.2.1 lib/osc_machete_rails/engine.rb
osc_machete_rails-1.2.0 lib/osc_machete_rails/engine.rb