From f056c5f72bfa617ac2f63f308681f84f51e16267 Mon Sep 17 00:00:00 2001 From: Yevhenii Hurin Date: Mon, 9 Oct 2023 02:22:15 +0300 Subject: [PATCH] Sort other tweets --- app/controllers/tweets_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/tweets_controller.rb b/app/controllers/tweets_controller.rb index c290906..e8ffb65 100644 --- a/app/controllers/tweets_controller.rb +++ b/app/controllers/tweets_controller.rb @@ -9,7 +9,7 @@ def index .group("tweets.id") .order("metrics_count DESC") @tweets = scope.limit(10).map(&:decorate) - @other_tweets = Tweet.limit(400).map(&:decorate) + @other_tweets = Tweet.order("created_at DESC").limit(400).map(&:decorate) respond_to do |format| format.html # renders index.html.slim end