[openstreetmap/openstreetmap-website] What should we do about note comments? (Issue #3831)

Andy Allan notifications at github.com
Wed Dec 7 20:36:08 UTC 2022


The way that I would approach this refactoring would be roughly:

* Corral all the complexity and special casing into the models, rather than having the logic spread out over controllers and views as we currently have. So if you ask for e.g. `@note.comments` you would not get the special first comment in the list returned. Other things like `current_user.note_comments` would also behave as expected, with no special first comments that then need to be ignored.
* Rework the controllers and views to act as we would expect for the end stage, e.g. when creating a Note you provide the body and author to `Note#create` rather than the two-step process currently in api/notes_controller
* Create a migration to add the author and body to the Note database tables, start to use them when they are available, and start backfilling them from the special first comments. Destroy the unnecessary special first comments when they are no longer needed.
* The output of the API has to remain the same for now, of course. But the special first comments can be synthesised for API 0.6, and dropped in the next API version so that only the genuine comments are shown.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/issues/3831#issuecomment-1341562044
You are receiving this because you are subscribed to this thread.

Message ID: <openstreetmap/openstreetmap-website/issues/3831/1341562044 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20221207/715f4f55/attachment.htm>


More information about the rails-dev mailing list