fixes in active record query for reorder in rails guides

I found a issue in rails guides in Active record Query.

In the reorder option it is showing select comments of a post and reorder them according to name column but the query for that is :-
SELECT * FROM posts WHERE id = 10 ORDER BY name

Ideally It should be :-
 SELECT * FROM comments WHERE post_id = 10 ORDER BY name

and same is the issue with without reorder:-
SELECT * FROM posts WHERE id = 10 ORDER BY posted_at DESC

It should be:-
SELECT * FROM comments WHERE post_id = 10 ORDER BY posted_at DESC