From d1f3e54abe674e49ae5e739fedd9a2c1a437e9ee Mon Sep 17 00:00:00 2001 From: Rob Sterner Date: Mon, 27 Nov 2023 17:04:00 -0500 Subject: [PATCH] add a `current_company` helper --- app/controllers/application_controller.rb | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 1ce30dbe..21439c9a 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -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