[openstreetmap/openstreetmap-website] Show tag changes in object history view (PR #6448)
Pablo Brasero
notifications at github.com
Mon Mar 2 11:33:15 UTC 2026
@pablobm commented on this pull request.
> @@ -0,0 +1,131 @@
+# frozen_string_literal: true
+
+module BrowseTagChangesHelper
+ include BrowseTagsHelper
+
+ def wrap_tags_with_version_changes(tags_to_values, _current_version = nil, all_versions = [])
+ # Find the previous usable version by looking backwards from the end
+ previous_version = all_versions
+ .reverse
+ .drop(1)
+ .find { |v| !v.redacted? || params[:show_redactions] }
+
+ previous_tags = previous_version&.tags || {}
+
+ tags_added = tags_modified = tags_unmodified = tags_removed = tags_with_unknown_versioning = {}
In fact, I think this doesn't really matter in the end because each variable is re-assigned rather than mutated. But still good practice.
--
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/6448#discussion_r2871932553
You are receiving this because you are subscribed to this thread.
Message ID: <openstreetmap/openstreetmap-website/pull/6448/review/3875625593 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20260302/03d9a32d/attachment.htm>
More information about the rails-dev
mailing list