]> git.openstreetmap.org Git - rails.git/commitdiff
Merge remote-tracking branch 'upstream/pull/3403'
authorTom Hughes <tom@compton.nu>
Wed, 22 Dec 2021 15:26:23 +0000 (15:26 +0000)
committerTom Hughes <tom@compton.nu>
Wed, 22 Dec 2021 15:26:23 +0000 (15:26 +0000)
app/controllers/users_controller.rb
app/models/user.rb
test/controllers/browse_controller_test.rb
test/models/user_test.rb

index 4f05ece74bc0c451b487de11655e7d847057380d..f7a82c08c6c9df94c00f0b8c6b8be42e19d0c335 100644 (file)
@@ -208,9 +208,9 @@ class UsersController < ApplicationController
   end
 
   ##
-  # delete a user, marking them as deleted and removing personal data
+  # destroy a user, marking them as deleted and removing personal data
   def destroy
-    @user.delete
+    @user.destroy
     redirect_to user_path(:display_name => params[:display_name])
   end
 
index 8f02e35cf172fd82e40c58a9ab200f55e3680be9..1bb53215261d426294449a00e038733e2bab6900 100644 (file)
@@ -242,8 +242,8 @@ class User < ApplicationRecord
   end
 
   ##
-  # delete a user - leave the account but purge most personal data
-  def delete
+  # destroy a user - leave the account but purge most personal data
+  def destroy
     avatar.purge_later
 
     self.display_name = "user_#{id}"
index 135e49d3f2354c7635516328d9d378a1e957562d..d9f4401bfbf83e61ddd5d6a54c944e715754a816 100644 (file)
@@ -161,7 +161,7 @@ class BrowseControllerTest < ActionDispatch::IntegrationTest
     assert_select "div.note-comments ul li", :count => 2
     assert_select "div.details", /Resolved by #{user.display_name}/
 
-    user.delete
+    user.destroy
 
     reset!
 
index c34b4b81fe310f092b02088ce8b321711ad45865..76f5200912bee738cd54cdec5574bc1db1ff2119 100644 (file)
@@ -256,9 +256,9 @@ class UserTest < ActiveSupport::TestCase
     assert create(:moderator_user).has_role?("moderator")
   end
 
-  def test_delete
+  def test_destroy
     user = create(:user, :with_home_location, :description => "foo")
-    user.delete
+    user.destroy
     assert_equal "user_#{user.id}", user.display_name
     assert user.description.blank?
     assert_nil user.home_lat