[openstreetmap/openstreetmap-website] Add the ability to rate limit edits (PR #4319)

Andy Allan notifications at github.com
Wed Nov 15 12:29:45 UTC 2023


@gravitystorm approved this pull request.

Other than the enum suggestion (which can be left for later, it's not a blocker) then I'm happy with this. It's a shame that the logic has to go in as a database function, since that's harder to iterate/debug/lint etc, but I think it's a good solution.

I'll leave this for @tomhughes to merge when he is ready, due to the operational considerations.

> @@ -51,6 +51,10 @@ def drop_enumeration(enumeration_name)
           execute "DROP TYPE #{enumeration_name}"
         end
 
+        def add_enumeration_value(enumeration_name, value)

Rails 7.1 now has `add_enum_value` and supports this for the postgresql adapter.

- https://api.rubyonrails.org/v7.1.2/classes/ActiveRecord/ConnectionAdapters/PostgreSQLAdapter.html#method-i-add_enum_value
- https://github.com/rails/rails/pull/44898

We could follow up with a separate PR to drop our other custom enum handling, since I think they are all built-in now.

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

Message ID: <openstreetmap/openstreetmap-website/pull/4319/review/1731880205 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20231115/4229a18d/attachment.htm>


More information about the rails-dev mailing list