Skip to content
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

Delegate alias_tracker creation to AR Relation rather than doing it ourselves #1493

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

Conversation

robinator
Copy link

@robinator robinator commented May 15, 2024

Closes #1491.

This PR is addressing an error we are experiencing on edge rails. This error is caused because the API for creating an ActiveRecord::Associations::AliasTracker has changed in edge rails. It now wants to eat a connection pool rather than a connection. Knowing nothing about ransack's internals, from what I can tell it shouldn't need to use this API directly, and should just ask it's ActiveRecord::Relation to create a fresh AliasTracker instead. This patch includes my naive way of doing so. It fixes the breakages in our own test suite. Please let me know if there are other additions I should include.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Getting with_connection for an instance of ActiveRecord::ConnectionAdapters::PostgreSQLAdapter
1 participant