1
0
Fork 0
mirror of https://github.com/maybe-finance/maybe.git synced 2025-07-24 15:49:39 +02:00

Rubocop updates (#1118)

* Minimal code style enforcement

* Formatting and lint code updates (no change in functionality)
This commit is contained in:
Zach Gollwitzer 2024-08-23 10:06:24 -04:00 committed by GitHub
parent 359bceb58e
commit eef4c2643b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
41 changed files with 529 additions and 519 deletions

View file

@ -13,27 +13,27 @@ module Authentication
private
def authenticate_user!
if user = User.find_by(id: session[:user_id])
Current.user = user
else
redirect_to new_session_url
def authenticate_user!
if user = User.find_by(id: session[:user_id])
Current.user = user
else
redirect_to new_session_url
end
end
end
def login(user)
Current.user = user
reset_session
session[:user_id] = user.id
set_last_login_at
end
def login(user)
Current.user = user
reset_session
session[:user_id] = user.id
set_last_login_at
end
def logout
Current.user = nil
reset_session
end
def logout
Current.user = nil
reset_session
end
def set_last_login_at
Current.user.update(last_login_at: DateTime.now)
end
def set_last_login_at
Current.user.update(last_login_at: DateTime.now)
end
end