af83/chouette-core

View on GitHub
app/controllers/redirect/base_controller.rb

Summary

Maintainability
A
0 mins
Test Coverage
# frozen_string_literal: true

module Redirect
  class BaseController < Chouette::UserController
    include DefaultPathHelper
    rescue_from DefaultPathHelper::NoDefaultWorkbenchError, with: :not_default_workbench

    private

    def not_default_workbench
      Rails.logger.warn "Can't redirect User ##{current_user.id} to Workbench resource"
      redirect_to root_path
    end
  end
end