Alain Pilon


420 Experience
4 Lessons Completed
0 Questions Solved


I will be in a similar situation and my solution will either be to cache the mention or store it in redis using the sgid and set it to auto expire in a few hours. Avatar may be out of date for a short duration because of the cache but it is a small price to pay to reduce load on the DB.

Posted in Deleting Comments In Nested Threads Discussion

I use your approach, but if the comment has no parents, I simply delete the record. No reasons to keep it poluting the UI

logo Created with Sketch.

Screencast tutorials to help you learn Ruby on Rails, Javascript, Hotwire, Turbo, Stimulus.js, PostgreSQL, MySQL, Ubuntu, and more. Icons by Icons8

© 2022 GoRails, LLC. All rights reserved.