[openstreetmap/openstreetmap-website] CRUD interface for moderation zones (PR #7148)
Pablo Brasero
notifications at github.com
Wed Jun 10 20:59:00 UTC 2026
@pablobm commented on this pull request.
> + 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|
That crossed my mind, but the checks use `active?` which is a method and won't be present in the dirty. Instead we'd have to call `ends_at_was?` explicitly which I'm not comfortable with.
--
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/7148#discussion_r3391469952
You are receiving this because you are subscribed to this thread.
Message ID: <openstreetmap/openstreetmap-website/pull/7148/review/4471534746 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20260610/0c6c71c2/attachment.htm>
More information about the rails-dev
mailing list