Remove CurrentUser.ip_addr.

Remove the `CurrentUser.ip_addr` global variable and replace it with
`request.remote_ip`. Before we had to track the current user's IP in a
global variable so that when we edited a post for example, we could pass
down the user's IP to the model and save it in the post_versions table.
Now that we now longer save IPs in version tables, we don't need a global
variable to get access to the current user's IP outside of controllers.
This commit is contained in:
evazion
2022-09-18 04:41:01 -05:00
parent d4da8499ce
commit 1d2bac7b95
41 changed files with 15 additions and 87 deletions

View File

@@ -65,7 +65,7 @@ class UsersController < ApplicationController
user_verifier = UserVerifier.new(CurrentUser.user, request)
@user = authorize User.new(
last_ip_addr: CurrentUser.ip_addr,
last_ip_addr: request.remote_ip,
last_logged_in_at: Time.zone.now,
requires_verification: user_verifier.requires_verification?,
level: user_verifier.initial_level,