Skip to content

DEV: Maintain activerecord relation when filtering visible tags #32210

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

nattsw
Copy link
Contributor

@nattsw nattsw commented Apr 8, 2025

This PR updates Topic visible_tags method to use ActiveRecord's query interface instead of Ruby's reject method. This change:

  • Preserves the ActiveRecord::Associations::CollectionProxy type in the return value
  • Performs filtering at the database level for better performance
  • Maintains chainability with other ActiveRecord methods

Before this change, the method was returning a plain Ruby array, which lost ActiveRecord's relation capabilities.

pento
pento previously approved these changes Apr 8, 2025
@nattsw
Copy link
Contributor Author

nattsw commented Apr 8, 2025

The error here is legit. However I will wait for some internal input here regarding tags (150624/10) before proceeding to fix the failures.

@pento pento dismissed their stale review April 8, 2025 09:51

Test failures.

@nattsw nattsw marked this pull request as draft April 10, 2025 02:35
Copy link

This pull request has been automatically marked as stale because it has been open for 60 days with no activity. To keep it open, remove the stale tag, push code, or add a comment. Otherwise, it will be closed in 14 days.

@github-actions github-actions bot added the Stale label Jun 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging this pull request may close these issues.

2 participants