[openstreetmap/openstreetmap-website] Fixes bug when deleted user's note lacks comments (PR #5609)

Nenad Vujicic notifications at github.com
Wed Feb 5 10:50:51 UTC 2025


### Description

PR fixes bug where a note of deleted user has no comments, but the code tries to access the first comment by switching to using `.all_comments` (instead of `.comments`) and removing dropping first comment (if author is deleted) when displaying notes comments in sidebar.

Suggested [here](https://github.com/openstreetmap/openstreetmap-website/pull/5579#issuecomment-2634185487).

### How has this been tested?

Automated tests, manual testing before and after migration.
You can view, comment on, or merge this pull request online at:

  https://github.com/openstreetmap/openstreetmap-website/pull/5609

-- Commit Summary --

  * Switches from comments to all_comments
  * Removes dropping note's first comment

-- File Changes --

    M app/models/note.rb (4)
    M app/views/notes/show.html.erb (4)

-- Patch Links --

https://github.com/openstreetmap/openstreetmap-website/pull/5609.patch
https://github.com/openstreetmap/openstreetmap-website/pull/5609.diff

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

Message ID: <openstreetmap/openstreetmap-website/pull/5609 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20250205/c11e2459/attachment.htm>


More information about the rails-dev mailing list