Sha256: 710f662a1a1a69a25625a6aa6035fd7c187f0d5d507e8a01acac47143afebce6
Contents?: true
Size: 690 Bytes
Versions: 48
Compression:
Stored size: 690 Bytes
Contents
module Effective class CpdCyclesController < ApplicationController before_action(:authenticate_user!) if defined?(Devise) # If they visit /cpd_cycles/1, redirect to their statement for that cycle def show cycle = Effective::CpdCycle.find(params[:id]) EffectiveResources.authorize!(self, :show, cycle) statement = EffectiveCpd.CpdStatement.where(cpd_cycle: cycle, user: current_user).first if statement.present? redirect_to effective_cpd.cpd_cycle_cpd_statement_build_path(cycle, statement, statement.next_step) else redirect_to effective_cpd.cpd_cycle_cpd_statement_build_path(cycle, :new, :start) end end end end
Version data entries
48 entries across 48 versions & 1 rubygems