כיצד לבצע שינויים בצד ה-backend של יישום discourse באמצעות rails

I hit that query but main problem is that where this featured topics are displayed on the home, on which .html file have code to shown this data on UI.
I already made a queries for what data I need to sort but problem is where I put the query into which model.