Skip to content

Fix .left_outer_joins when multiple associations have the same child. #52850

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

Merged
merged 1 commit into from
Sep 11, 2024

Conversation

garrettblehm
Copy link
Contributor

@garrettblehm garrettblehm commented Sep 9, 2024

Motivation / Background

Fixes #41498

This Pull Request has been created to fix an issue where .left_outer_joins used with multiple associations that have the same child association but different parents does not join all parents.

Detail

This Pull Request fixes #41498.

Checklist

Before submitting the PR make sure the following are checked:

  • This Pull Request is related to one change. Unrelated changes should be opened in separate PRs.
  • Commit message has a detailed description of what changed and why. If this PR fixes a related issue include it in the commit message. Ex: [Fix #issue-number]
  • Tests are added or updated if you fix a bug or add a feature.
  • CHANGELOG files are updated for the changed libraries if there is a behavior change or additional feature. Minor bug fixes and documentation changes should not be included.

@garrettblehm garrettblehm force-pushed the active_record_missing_joins branch 2 times, most recently from a3197bf to 2c961fd Compare September 9, 2024 18:24
Signed-off-by: Garrett Blehm <gblehm@fleetio.com>
@garrettblehm garrettblehm force-pushed the active_record_missing_joins branch from 2c961fd to 50bbff3 Compare September 10, 2024 15:14
@kamipo kamipo merged commit 418e2ed into rails:main Sep 11, 2024
3 checks passed
kamipo added a commit that referenced this pull request Sep 11, 2024
Remove unused require, quote support for sqlserver, etc.
dhh added a commit that referenced this pull request Sep 11, 2024
* main:
  Always separate config blocks with a CR
  Fixup tests for #52850
  Stop recommending Kredis
  Fix test failure caused by #52780
  Mention `assume_ssl` in SSL middleware.
kamipo added a commit that referenced this pull request Sep 12, 2024
Fix `.left_outer_joins` when multiple associations have the same child.
kamipo added a commit that referenced this pull request Sep 12, 2024
Fix `.left_outer_joins` when multiple associations have the same child.
dhh added a commit that referenced this pull request Sep 13, 2024
* main:
  Skip solid_cable gem if skip_action_cable is set (#52919)
  Call prerecord in test parallelization
  Fix a documentation name mismatch in cookies.rb
  Revert "Assign id attributes first in Active Record attribute assignment"
  Do not populate CurrentAttributes#attributes when not using defaults
  Suppress a RuboCop offense after running `rails new` with `--devcontainer`
  Fix small typo for Solid Cable changelog [ci skip] (#52911)
  Use less queries when updating nested attributes
  Load routes in LazyRoutesSet#recognize_path
  Slim down the gem section for Solid
  Add Solid Cable (#52889)
  Fix syntax error in user.rb
  Improve Active Record Association Callbacks docs [ci skip]
  Assign id attributes first in Active Record attribute assignment
  Always separate config blocks with a CR
  Fixup tests for #52850
  Replace "healthcheck" with "health check" in documentation. [ci-skip]
Copy link

@Funnyenzo Funnyenzo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Always be careful

DanielaVelasquez pushed a commit to DanielaVelasquez/rails that referenced this pull request Oct 3, 2024
Remove unused require, quote support for sqlserver, etc.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ActiveRecord: Missing joined table after upgrading to 6.1
3 participants