[openstreetmap/openstreetmap-website] Add a basic when-last-changed feature to the history pages (PR #3535)
JesseWeinstein
notifications at github.com
Mon Apr 25 16:54:04 UTC 2022
@JesseWeinstein commented on this pull request.
> @@ -75,4 +75,21 @@ def icon_tags(object)
def name_locales(object)
object.tags.keys.map { |k| Regexp.last_match(1) if k =~ /^name:(.*)$/ }.flatten
end
+
+ def tags_with_version_info(current_tags, old_objects)
+ version_history = {}
+
+ current_tags.each do |t|
+ version_history[t.k] = { :value => nil, :version => -1 }
+ end
+ old_objects.each do |old|
+ old.old_tags.each do |t|
+ if version_history.include?(t.k) && version_history[t.k][:value] != t.v
+ version_history[t.k] = { :value => t.v, :version => old.version,
+ :changeset => old.changeset, :timestamp => old.timestamp }
+ end
You are correct -- thanks for finding that! I've fixed it and added it to the test.
--
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/3535#discussion_r857836640
You are receiving this because you are subscribed to this thread.
Message ID: <openstreetmap/openstreetmap-website/pull/3535/review/952178793 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20220425/5a6c2580/attachment-0001.htm>
More information about the rails-dev
mailing list