[openstreetmap/openstreetmap-website] CRUD interface for moderation zones (PR #7148)
Tom Hughes
notifications at github.com
Tue Jul 21 21:45:44 UTC 2026
@tomhughes commented on this pull request.
Currently this allows a zero hour moderation rule, but does that make any sense? A zero hour user block has a special meaning of forcing people to read it before they can edit again but is that true here?
> + test "index, unauthenticated" do
+ get moderation_zones_url
+ assert_redirected_to login_url(:referer => moderation_zones_path)
+ end
In addition to "not authenticated" and "authenticated as moderator" we should probably have "authenticated as normal user" versions of each of these tests.
> @@ -0,0 +1,25 @@
+<%# locals: (moderation_zone:) %>
+
+<% content_for :head do %>
+ <%= javascript_include_tag "moderation_zone" %>
+<% end %>
+
+<%= bootstrap_form_with(:model => moderation_zone) do |form| %>
+ <%= form.text_field :name %>
+
+ <%= form.richtext_field :reason, :cols => 80, :rows => 20, :format => moderation_zone.reason_format %>
+
+ <%= form.form_group do %>
+ <%= form.label :zone %>
+ <div id="map" class="content_map border boder-secondary-subtle rounded z-0"></div>
Typo?
```suggestion
<div id="map" class="content_map border border-secondary-subtle rounded z-0"></div>
```
> @@ -40,6 +40,10 @@ def self.falls_within_any?(lon:, lat:)
where(
arel_table[:zone].st_contains(point)
- ).exists?
+ ).any?(&:active?)
I think `any?` here is realising the collection and evaluating the condition in ruby rather than pushing it down to sql?
--
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/7148#pullrequestreview-4749191412
You are receiving this because you are subscribed to this thread.
Message ID: <openstreetmap/openstreetmap-website/pull/7148/review/4749191412 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20260721/139c1bbd/attachment.htm>
More information about the rails-dev
mailing list