Skip to content

fix(core): align comments_ordered_by_submitted with STI base class - #2

Open
capy-ai[bot] wants to merge 1 commit into
masterfrom
capy/fix-sti-ordered-comments
Open

capy-ai[bot] wants to merge 1 commit into
masterfrom
capy/fix-sti-ordered-comments

Conversation

@capy-ai

@capy-ai capy-ai Bot commented Apr 2, 2026

Copy link
Copy Markdown

This PR updates comments_ordered_by_submitted to use self.class.base_class.name instead of self.class.name. This fix ensures consistency with find_comments_for and Comment.build_from, which already use the base class name for commentable_type. Without this change, comments on STI subclasses (e.g., Article < Post) are stored with the base class type but queried by the subclass type, causing them to be missed.

  • Changed lib/acts_as_commentable_with_threading.rb:52 to use self.class.base_class.name
  • Verify behavior aligns with find_comments_for and Comment.build_from

Open in Capy SCO-2 · 5.4

@capy-ai capy-ai Bot added the capy Generated by capy.ai label Apr 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

capy Generated by capy.ai

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant