[openstreetmap/openstreetmap-website] Adds optional use of notes records (PR #5511)

Anton Khorev notifications at github.com
Tue Jan 21 15:34:47 UTC 2025


@AntonKhorev commented on this pull request.



>    def description
-    comments.first.body
+    if user_ip.nil? && user_id.nil?
+      comments.first.body
+    else
+      RichText.new("text", self[:description])
+    end
   end

Copying is not the problem, the problem is you won't be able to the description if the user who created it is deleted. You'll have to remember that whenever you access `note.description`.

There was a draft policy by DWG about deleted users that was supposed to be sent to LWG but wasn't. It says that DWG recommends note comments of deleted users to be visible. If that's impossible, "a comment is not shown because ..." is to be displayed instead. Descriptions are not mentioned but the same should apply to them.

The default solution if no decision was made was to replace description with "deleted" when the note is displayed:

https://github.com/openstreetmap/openstreetmap-website/pull/4481/files#diff-74d80704129ce910bd38a56b250122e716028ac0085b3627ea8875b9216b65ceR25-R29

Since you already started using `note.description`, one of the following things should happen:
- you remove deleted descriptions here in the model
- you remove them on use
- we actually do a *proper documented policy* (in other words it's easier to remove deleted descriptions for now)

-- 
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/5511#discussion_r1923944473
You are receiving this because you are subscribed to this thread.

Message ID: <openstreetmap/openstreetmap-website/pull/5511/review/2564995180 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20250121/da566d99/attachment-0001.htm>


More information about the rails-dev mailing list