stevekaplan123/carpe_diem

View on GitHub
app/controllers/application_controller.rb

Summary

Maintainability
A
0 mins
Test Coverage
class ApplicationController < ActionController::Base
  # check session on every page. will have to rewrite the tests
  before_action :authorize
  protect_from_forgery with: :exception
  require 'authenticate'

  protected
    def authorize
      unless logged_in?
        store_location
        flash[:danger] = "Please log in"
        redirect_to login_path
      end
    end
end