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

Fix ActiveRecordRelations compiler to dedup #all #1942

Merged
merged 1 commit into from
Jun 27, 2024
Merged

Conversation

bitwise-aiden
Copy link
Contributor

@bitwise-aiden bitwise-aiden commented Jun 27, 2024

Motivation

Rails head has been updated to include #all under ActiveRecord::QueryMethods (source).

Implementation

I had tried to update the QUERY_METHODS constant to remove the intersection with ActiveRecord::AssociationRelation.instance_methods as that is where all is originally coming from, but this was over zealous causing a bunch of errors.

The option I've gone with is to update the ones removed as "private api" since they overlap with what is done in Rails:

query_methods -= [:arel, :build_subquery, :construct_join_dependency, :extensions, :spawn]

Tests

Tested against rails head.

@bitwise-aiden bitwise-aiden merged commit df961ec into main Jun 27, 2024
30 checks passed
@bitwise-aiden bitwise-aiden deleted the ba-fix-arr-all branch June 27, 2024 15:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants