Sha256: 49cb58d9dbc3311e0c04f843f1988acfbb5efa0bad53735fc94223fb2e4a8c64

Contents?: true

Size: 1.13 KB

Versions: 15

Compression:

Stored size: 1.13 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: t(".notice"))
    end

    def enable
      @cron_entry = CronEntry.find(params[:cron_key])
      @cron_entry.enable
      redirect_back(fallback_location: cron_entries_path, notice: t(".notice"))
    end

    def disable
      @cron_entry = CronEntry.find(params[:cron_key])
      @cron_entry.disable
      redirect_back(fallback_location: cron_entries_path, notice: t(".notice"))
    end

    private

    def check_settings_migration!
      redirect_back(fallback_location: cron_entries_path, alert: t("good_job.cron_entries.pending_migrations")) unless GoodJob::Setting.migrated?
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
good_job-3.15.14 app/controllers/good_job/cron_entries_controller.rb
good_job-3.15.13 app/controllers/good_job/cron_entries_controller.rb
good_job-3.15.12 app/controllers/good_job/cron_entries_controller.rb
good_job-3.15.11 app/controllers/good_job/cron_entries_controller.rb
good_job-3.15.10 app/controllers/good_job/cron_entries_controller.rb
good_job-3.15.9 app/controllers/good_job/cron_entries_controller.rb
good_job-3.15.8 app/controllers/good_job/cron_entries_controller.rb
good_job-3.15.7 app/controllers/good_job/cron_entries_controller.rb
good_job-3.15.6 app/controllers/good_job/cron_entries_controller.rb
good_job-3.15.5 app/controllers/good_job/cron_entries_controller.rb
good_job-3.15.4 app/controllers/good_job/cron_entries_controller.rb
good_job-3.15.3 app/controllers/good_job/cron_entries_controller.rb
good_job-3.15.2 app/controllers/good_job/cron_entries_controller.rb
good_job-3.15.1 app/controllers/good_job/cron_entries_controller.rb
good_job-3.15.0 app/controllers/good_job/cron_entries_controller.rb