From e2eae6a0c5f2b40b8bcb0fbafebf44e7df10d2e1 Mon Sep 17 00:00:00 2001 From: Nicolas Bally Date: Sun, 16 May 2021 22:20:34 +0200 Subject: [PATCH] suite --- app/models/forum_topic.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/forum_topic.rb b/app/models/forum_topic.rb index e594843..e930507 100644 --- a/app/models/forum_topic.rb +++ b/app/models/forum_topic.rb @@ -23,7 +23,7 @@ class ForumTopic < ActiveRecord::Base belongs_to :category, :class_name => "ForumCategory" - default_scope -> {order "forum_messages.created_at DESC"} + default_scope -> {includes("forum_messages").order "forum_messages.created_at DESC"} after_create do topic = self