Skip to content

Instantly share code, notes, and snippets.

@rwehresmann
Created August 24, 2019 01:22
Show Gist options
  • Select an option

  • Save rwehresmann/7c22a7c8afde675fe7789917388f34a9 to your computer and use it in GitHub Desktop.

Select an option

Save rwehresmann/7c22a7c8afde675fe7789917388f34a9 to your computer and use it in GitHub Desktop.
class ApplicationController < ActionController::Base
protect_from_forgery with: :exception
helper_method :current_user
helper_method :current_admin_user
def current_user
@current_user ||= User.find_by(id: session[:user_id])
end
def current_admin_user
@current_admin_user ||= User.find_by(id: session[:admin_user_id])
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment