Sha256: 7a24a23fbe3d90af654e0b040cb1f7be57b3383bc781c544107cfed661ba99c2

Contents?: true

Size: 1.18 KB

Versions: 38

Compression:

Stored size: 1.18 KB

Contents

# frozen_string_literal: true
module GoodJob
  class CronEntriesController < GoodJob::ApplicationController
    before_action :check_settings_migration!, only: [:enable, :disable]

    def index
      @cron_entries = CronEntry.all
    end

    def show
      @cron_entry = CronEntry.find(params[:cron_key])
      @jobs_filter = JobsFilter.new(params, @cron_entry.jobs)
    end

    def enqueue
      @cron_entry = CronEntry.find(params[:cron_key])
      @cron_entry.enqueue(Time.current)
      redirect_back(fallback_location: cron_entries_path, notice: "Cron entry has been enqueued.")
    end

    def enable
      @cron_entry = CronEntry.find(params[:cron_key])
      @cron_entry.enable
      redirect_back(fallback_location: cron_entries_path, notice: "Cron entry has been enabled.")
    end

    def disable
      @cron_entry = CronEntry.find(params[:cron_key])
      @cron_entry.disable
      redirect_back(fallback_location: cron_entries_path, notice: "Cron entry has been disabled.")
    end

    private

    def check_settings_migration!
      redirect_back(fallback_location: cron_entries_path, alert: "Requires pending GoodJob database migration.") unless GoodJob::Setting.migrated?
    end
  end
end

Version data entries

38 entries across 38 versions & 1 rubygems

Version Path
good_job-3.14.2 app/controllers/good_job/cron_entries_controller.rb
good_job-3.14.1 app/controllers/good_job/cron_entries_controller.rb
good_job-3.14.0 app/controllers/good_job/cron_entries_controller.rb
good_job-3.13.0 app/controllers/good_job/cron_entries_controller.rb
good_job-3.12.8 app/controllers/good_job/cron_entries_controller.rb
good_job-3.12.7 app/controllers/good_job/cron_entries_controller.rb
good_job-3.12.6 app/controllers/good_job/cron_entries_controller.rb
good_job-3.12.5 app/controllers/good_job/cron_entries_controller.rb
good_job-3.12.4 app/controllers/good_job/cron_entries_controller.rb
good_job-3.12.3 app/controllers/good_job/cron_entries_controller.rb
good_job-3.12.2 app/controllers/good_job/cron_entries_controller.rb
good_job-3.12.1 app/controllers/good_job/cron_entries_controller.rb
good_job-3.12.0 app/controllers/good_job/cron_entries_controller.rb
good_job-3.11.1 app/controllers/good_job/cron_entries_controller.rb
good_job-3.11.0 app/controllers/good_job/cron_entries_controller.rb
good_job-3.10.1 app/controllers/good_job/cron_entries_controller.rb
good_job-3.10.0 app/controllers/good_job/cron_entries_controller.rb
good_job-3.9.0 app/controllers/good_job/cron_entries_controller.rb
good_job-3.8.0 app/controllers/good_job/cron_entries_controller.rb
good_job-3.7.4 app/controllers/good_job/cron_entries_controller.rb