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:
@@ -6,7 +6,6 @@ module PostSets
|
||||
setup do
|
||||
@user = FactoryBot.create(:user)
|
||||
CurrentUser.user = @user
|
||||
CurrentUser.ip_addr = "127.0.0.1"
|
||||
|
||||
@post_1 = FactoryBot.create(:post, :tag_string => "a")
|
||||
@post_2 = FactoryBot.create(:post, :tag_string => "b")
|
||||
@@ -15,7 +14,6 @@ module PostSets
|
||||
|
||||
teardown do
|
||||
CurrentUser.user = nil
|
||||
CurrentUser.ip_addr = nil
|
||||
end
|
||||
|
||||
context "a set for page 2" do
|
||||
|
||||
Reference in New Issue
Block a user