[openstreetmap/openstreetmap-website] CRUD interface for moderation zones (PR #7148)
Tom Hughes
notifications at github.com
Wed Jun 10 18:03:42 UTC 2026
@tomhughes commented on this pull request.
I'm a little reluctant to start adding Terra Draw until we've done the conversion of the front page and decided how we're going to handle drawing there - quite possibly Terra Draw is the answer but I want to be sure we don't wind up with two solutions to the same problem.
Also there's a commit early on that adds a blank line to the end of `en.yml` that gets removed again late.
> + end
+
+ def check_revocation(original, changes)
+ original.revoker = current_user if original.active? && !projected_record(original, changes).active?
+ end
+
+ def updating_without_revoking?(original, changes)
+ original.active? && projected_record(original, changes).active?
+ end
+
+ def reactivating?(original, changes)
+ !original.active? && projected_record(original, changes).active?
+ end
+
+ def projected_record(original, changes)
+ original.dup.tap do |duplicate|
Instead of creating a duplicate record and changing it then throwing it away, could we not just assign the new attributes, then use `_was` methods from `ActiveModel::Dirty` to do checks, and then save the changed record?
--
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/7148#pullrequestreview-4470354136
You are receiving this because you are subscribed to this thread.
Message ID: <openstreetmap/openstreetmap-website/pull/7148/review/4470354136 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20260610/306c14bb/attachment-0001.htm>
More information about the rails-dev
mailing list