[openstreetmap/openstreetmap-website] Limit the number of users counted for users#index (PR #5181)

Anton Khorev notifications at github.com
Wed Sep 11 09:26:38 UTC 2024


@AntonKhorev commented on this pull request.



> @@ -38,7 +38,9 @@ def index
       users = users.where(:status => @params[:status]) if @params[:status]
       users = users.where(:creation_ip => @params[:ip]) if @params[:ip]
 
-      @users_count = users.count
+      @users_count = users.limit(501).count
+      @users_count = "500+" if @users_count > 500

I was told [this](https://github.com/openstreetmap/openstreetmap-website/pull/4201#discussion_r1310176384) about "number+".

-- 
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/5181#pullrequestreview-2296192259
You are receiving this because you are subscribed to this thread.

Message ID: <openstreetmap/openstreetmap-website/pull/5181/review/2296192259 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20240911/cbf9f171/attachment.htm>


More information about the rails-dev mailing list