[openstreetmap/openstreetmap-website] Adds optional use of note's author and description v2 (PR #5579)

Anton Khorev notifications at github.com
Mon Feb 3 22:35:06 UTC 2025


@AntonKhorev commented on this pull request.



> +  def note_description(author, description, user_id, user_ip)
+    if !(user_id.nil? && user_ip.nil?) && !author.nil? && author.status == "deleted"
+      RichText.new("text", t("notes.show.description_when_author_is_deleted"))
+    else
+      description
+    end
+  end

By *Why wouldn't you start with a helper?* I meant *Why wouldn't you make it the first commit of the PR*.

As long as you're taking `description` from exactly the same place as `author`, you only need to check if `author` is deleted. You don't need to check `user_id` and `user_ip`. You already have a commit doing exactly that in another PR: https://github.com/openstreetmap/openstreetmap-website/pull/5511/commits/9e70276e1997d22e7e4cf496b87157749bb9e468.

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

Message ID: <openstreetmap/openstreetmap-website/pull/5579/review/2591288754 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20250203/ffe166f9/attachment.htm>


More information about the rails-dev mailing list