"delete" is generally used for immediate SQL deletion without running
any callbacks or other ruby code, whereas "destroy" will trigger callbacks.
Although we don't currently use any callbacks, let's rename this method to
align better with the convention.
- # delete a user, marking them as deleted and removing personal data
+ # destroy a user, marking them as deleted and removing personal data
redirect_to user_path(:display_name => params[:display_name])
end
redirect_to user_path(:display_name => params[:display_name])
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}"
avatar.purge_later
self.display_name = "user_#{id}"
assert_select "div.note-comments ul li", :count => 2
assert_select "div.details", /Resolved by #{user.display_name}/
assert_select "div.note-comments ul li", :count => 2
assert_select "div.details", /Resolved by #{user.display_name}/
assert create(:moderator_user).has_role?("moderator")
end
assert create(:moderator_user).has_role?("moderator")
end
user = create(:user, :with_home_location, :description => "foo")
user = create(:user, :with_home_location, :description => "foo")
assert_equal "user_#{user.id}", user.display_name
assert user.description.blank?
assert_nil user.home_lat
assert_equal "user_#{user.id}", user.display_name
assert user.description.blank?
assert_nil user.home_lat