From 5d750670d4130019f7702f78fd16b904f547a118 Mon Sep 17 00:00:00 2001 From: arjun810 <23281+arjun810@users.noreply.github.com> Date: Thu, 2 Apr 2026 06:50:11 +0000 Subject: [PATCH] Use base_class.name in comments_ordered_by_submitted for STI compatibility --- lib/acts_as_commentable_with_threading.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/acts_as_commentable_with_threading.rb b/lib/acts_as_commentable_with_threading.rb index 7f69dd7..18081eb 100644 --- a/lib/acts_as_commentable_with_threading.rb +++ b/lib/acts_as_commentable_with_threading.rb @@ -49,7 +49,7 @@ def root_comments # Helper method to sort comments by date def comments_ordered_by_submitted - Comment.where(:commentable_id => id, :commentable_type => self.class.name).order('created_at DESC') + Comment.where(:commentable_id => id, :commentable_type => self.class.base_class.name).order('created_at DESC') end # Helper method that defaults the submitted time.