Skip to content

Commit

Permalink
add a current_company helper
Browse files Browse the repository at this point in the history
  • Loading branch information
fermion committed Nov 27, 2023
1 parent bd5f84a commit d1f3e54
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions app/controllers/application_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@ class ApplicationController < ActionController::Base
def current_user
@current_user ||= authenticate_by_session(User)
end
helper_method :current_user

def current_company
@current_company ||= current_user.current_company
end
helper_method :current_company

def require_user!
return if current_user
Expand Down

0 comments on commit d1f3e54

Please sign in to comment.