]> git.openstreetmap.org Git - rails.git/commitdiff
Replace creation_ip with creation_address
authorTom Hughes <tom@compton.nu>
Sun, 15 Sep 2024 18:37:48 +0000 (19:37 +0100)
committerTom Hughes <tom@compton.nu>
Sun, 15 Sep 2024 18:38:21 +0000 (19:38 +0100)
app/controllers/users_controller.rb
app/views/users/_user.html.erb
app/views/users/show.html.erb
script/update-spam-blocks
test/controllers/users_controller_test.rb

index fc893c9c3194f6c40a65ce61e1d73e9824ba0747..63a83ad1da8ad9803c3980ade89dbe0755398bea 100644 (file)
@@ -36,7 +36,7 @@ class UsersController < ApplicationController
 
       users = User.all
       users = users.where(:status => @params[:status]) if @params[:status]
-      users = users.where(:creation_ip => @params[:ip]) if @params[:ip]
+      users = users.where(:creation_address => @params[:ip]) if @params[:ip]
 
       @users_count = users.limit(501).count
       @users_count = I18n.t("count.at_least_pattern", :count => 500) if @users_count > 500
@@ -268,7 +268,6 @@ class UsersController < ApplicationController
   def save_new_user(email_hmac, referer = nil)
     current_user.data_public = true
     current_user.description = "" if current_user.description.nil?
-    current_user.creation_ip = request.remote_ip
     current_user.creation_address = request.remote_ip
     current_user.languages = http_accept_language.user_preferred_languages
     current_user.terms_agreed = Time.now.utc
index ef50ccaf2fb4bffa27c19ce8950fbbd6b7e13209..2fb14b6bdf7056f2196e4c476905f49480e0d758 100644 (file)
@@ -4,10 +4,10 @@
   </td>
   <td>
     <p>
-      <% if user.creation_ip %>
+      <% if user.creation_address %>
         <%= t "users.index.summary_html",
               :name => link_to(user.display_name, user),
-              :ip_address => link_to(user.creation_ip, :ip => user.creation_ip),
+              :ip_address => link_to(user.creation_address, :ip => user.creation_address),
               :date => l(user.created_at, :format => :friendly) %>
       <% else %>
         <%= t "users.index.summary_no_ip_html",
index 44319b384f4ac313b39502b99150e05d2ce08ef8..d479b1d56dad13e0ab1e94e5188f8b6331ccf2cd 100644 (file)
             <dl class="list-inline">
               <dt class="list-inline-item m-0"><%= t ".email address" %></dt>
               <dd class="list-inline-item"><%= @user.email %></dd>
-              <% unless @user.creation_ip.nil? -%>
+              <% unless @user.creation_address.nil? -%>
                 <dt class="list-inline-item m-0"><%= t ".created from" %></dt>
-                <dd class="list-inline-item"><%= link_to @user.creation_ip, users_path(:ip => @user.creation_ip) %></dd>
+                <dd class="list-inline-item"><%= link_to @user.creation_address, users_path(:ip => @user.creation_address) %></dd>
               <% end -%>
               <dt class="list-inline-item m-0"><%= t ".status" %></dt>
               <dd class="list-inline-item"><%= link_to @user.status.capitalize, users_path(:status => @user.status) %></dd>
index b5656f6ac0b5b7aad20208084b990789985fdc9b..7d665454582a842ebb09d6bf2d313dcee955a64d 100755 (executable)
@@ -8,7 +8,7 @@ addresses = User.count(
     :status => %w[suspended deleted],
     :creation_time => Time.now.utc - 28.days..Time.now.utc
   },
-  :group => :creation_ip
+  :group => :creation_address
 )
 
 addresses.each do |address, count|
index 4f4edf10b034a82ad562b995bbb5328ab6db0382..dda157f01552cbcbc62664b64183d9e83ed56ae8 100644 (file)
@@ -476,7 +476,7 @@ class UsersControllerTest < ActionDispatch::IntegrationTest
     moderator_user = create(:moderator_user)
     administrator_user = create(:administrator_user)
     _suspended_user = create(:user, :suspended)
-    _ip_user = create(:user, :creation_ip => "1.2.3.4")
+    _ip_user = create(:user, :creation_address => "1.2.3.4")
 
     # There are now 7 users - the five above, plus two extra "granters" for the
     # moderator_user and administrator_user