budget/app/controllers/concerns/authenticatable.rb
Andrew Tomaka 455a20283e
All checks were successful
Ruby CI / test (pull_request) Successful in 49s
Check registered for session links
2024-08-16 19:53:02 -04:00

13 lines
239 B
Ruby

module Authenticatable
extend ActiveSupport::Concern
included do
before_action :authenticate_user
end
private
def authenticate_user
Current.user = User.find_by(id: session[:current_user_id]) || GuestUser.new
end
end