Sha256: 8cfec6484dc1895a7cdd2c9c8f2fa524b12154b107ed871e8e9d7d2748b4cb9f

Contents?: true

Size: 734 Bytes

Versions: 8

Compression:

Stored size: 734 Bytes

Contents

class MissionControl::Jobs::RecurringTasksController < MissionControl::Jobs::ApplicationController
  before_action :ensure_supported_recurring_tasks
  before_action :set_recurring_task, only: :show

  def index
    @recurring_tasks = MissionControl::Jobs::Current.server.recurring_tasks
  end

  def show
    @jobs_page = MissionControl::Jobs::Page.new(@recurring_task.jobs, page: params[:page].to_i)
  end

  private
    def ensure_supported_recurring_tasks
      unless recurring_tasks_supported?
        redirect_to root_url, alert: "This server doesn't support recurring tasks"
      end
    end

    def set_recurring_task
      @recurring_task = MissionControl::Jobs::Current.server.find_recurring_task(params[:id])
    end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
mission_control-jobs-0.4.0 app/controllers/mission_control/jobs/recurring_tasks_controller.rb
mission_control-jobs-0.3.3 app/controllers/mission_control/jobs/recurring_tasks_controller.rb
mission_control-jobs-0.3.2 app/controllers/mission_control/jobs/recurring_tasks_controller.rb
mission_control-jobs-0.3.1 app/controllers/mission_control/jobs/recurring_tasks_controller.rb
mission_control-jobs-0.3.0 app/controllers/mission_control/jobs/recurring_tasks_controller.rb
mission_control-jobs-0.2.2 app/controllers/mission_control/jobs/recurring_tasks_controller.rb
mission_control-jobs-0.2.1 app/controllers/mission_control/jobs/recurring_tasks_controller.rb
mission_control-jobs-0.2.0 app/controllers/mission_control/jobs/recurring_tasks_controller.rb