[openstreetmap/openstreetmap-website] Add deactivates_at date to user blocks (PR #5069)
Anton Khorev
notifications at github.com
Wed Aug 14 01:15:16 UTC 2024
@AntonKhorev commented on this pull request.
> @@ -20,7 +20,7 @@ def block_status(block)
# the max of the last update time or the ends_at time is when this block finished
# either because the user viewed the block (updated_at) or it expired or was
# revoked (ends_at)
- last_time = [block.ends_at, block.updated_at].max
+ last_time = block.deactivates_at || [block.ends_at, block.updated_at].max
Yes, this is until backfilling is done. After that the logic will be simpler everywhere. `last_time` is just `block.deactivates_at`, `block.active?` is comparing the current time with `block.deactivates_at`.
--
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/5069#discussion_r1716175524
You are receiving this because you are subscribed to this thread.
Message ID: <openstreetmap/openstreetmap-website/pull/5069/review/2236947308 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20240813/a996f312/attachment.htm>
More information about the rails-dev
mailing list