Sha256: 014fd544165e14a0e5bd938ecf2f8780bad4d4ac06101ec9513e5817bafc6bb8
Contents?: true
Size: 1.02 KB
Versions: 12
Compression:
Stored size: 1.02 KB
Contents
module MissionControl::Jobs::ApplicationScoped extend ActiveSupport::Concern included do before_action :set_application around_action :activating_job_server delegate :applications, to: MissionControl::Jobs end private def set_application @application = find_application or raise MissionControl::Jobs::Errors::ResourceNotFound, "Application not found" MissionControl::Jobs::Current.application = @application end def find_application if params[:application_id] applications[params[:application_id]] else applications.first end end def activating_job_server(&block) @server = find_server or raise MissionControl::Jobs::Errors::ResourceNotFound, "Server not found" MissionControl::Jobs::Current.server = @server @server.activating(&block) end def find_server if params[:server_id] MissionControl::Jobs::Current.application.servers[params[:server_id]] else @application.servers.first end end end
Version data entries
12 entries across 12 versions & 1 rubygems