-
Notifications
You must be signed in to change notification settings - Fork 50
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
Nested merge-joins query causes NoMethodError with ActiveRecord 6.1.4.4 #119
Comments
Thank you for your great bug report @yysaki. I'll work on this on monday but I think the fix should be easy. The |
@rzane this fix was quit small. I didn't pay attention to the method visibility :/ @yysaki Sry for your bad upgrade experiance. I got the baby_squeel tests green but haven't used the version in our application because we are still upgrading to Rails 6.0 Your test is green with: If you find any other bugs please feel free to report them. |
Fixed in #120. Version 1.4.4 released. |
* Find the table * Use polyamorous from master * With activerecord-hackery/ransack#1004, all but one polymorphism test is fixed. There are still several failures. Basically, any test that does an outer join is still doing an inner join. * Explain how this is completely broken * Add byebug for development/testing * Have Active Record build tables for their aliases This may help with rzane#97. * Fix test for equivalent logic The new version of Active Record or Polyamorous seems to switch the order of these two SQL conditions, but the new statement is logically equivalent to the old one. * Use `variants` for SQL snapshot change * Make it possible to get good polymorphic joins Actually getting polymorphic joins to work correctly will require either explicitly specifying the master branch of the `ransack` project (commit c9cc20de9e0f or something with equivalent functionality) in the project `Gemfile` or the `ransack` project releasing a new 2.x (> 2.3.2) version with that functionality. Addresses most of the Active Record 5.2.x (>= 5.2.1) problems in rzane#97. The only remaining issues are around inner joins after left joins. * Track all associations used to find correct alias By tracking the associations accumulated within an expression, we can best even Active Record's own `#where` method's ability to correctly set conditions on column values via associations. * Reimplement #find_join_association iteratively Replacing recursive method calls with plain iteration is almost certainly more performant. * Revert unnecessary changes from commit 90e02e2 * Lock down the supported versions of ActiveRecord * Update rspec, rake, and sqlite3 * Run against Ruby 2.6 * Drop support for Active Record versions that have reached EOL * Remove old variants * Remove broken image from the readme * Install latest bundler * Explicit require test dependencies * Remove filewatcher * Run on GitHub actions * Require coveralls * Run as a matrix * Share the environment variables * Use the coveralls action * Not sure what is going on here... * Run against 5.2.0 and 5.2.5 * Give each job a name * Remove coverage * Mark failing tests as pending * Get 5.2.0 passing again * Remove coverage * Bump * Merge `join_dependency` back into this project, because my dreams did not really come true * Fix checking for version as string * Add changes from 1.4.0.beta1 to CHANGELOG.md * Build pull requests * remove old code from activerecord < 5.2 * removed BabySqueel::Pluck * reduce complexety after merging `join_dependency` back into this project * Fix table alias when joining a polymorphic table twice (rzane#108) * Update changelog for v1.4.0 * Bump version to v1.4.0 * Tidy up version comparison code * Bump version to v1.4.1 * add support for activerecord 6.0 * add support for activerecord 6.1 * speed up BabySqueel::ActiveRecord::VersionHelper * add support for activerecord 7.0 * update .github/workflows/build.yml to test rails 7.0 and ruby 3.0 / 3.1 * Apply version-specific monkey-patches outside of the method definition * Update changelog for v1.4.2 * v1.4.2 * ISSUE-117: left_joins performs INNER JOIN with ActiveRecord 6.1.4.4 * Update changelog for 1.4.3 release * Bump to v1.4.3 * ISSUE-119: Nested merge-joins query causes NoMethodError with ActiveRecord 6.1.4.4 rzane#119 * Prepare v1.4.4 * ISSUE-121: Drop support for ActiveRecord older than 6.0 * AR 6.1: fix - FrozenError: can't modify frozen object: [] * Bump v2.0.0 Co-authored-by: Ray Zane <[email protected]> Co-authored-by: Richard Weeks <[email protected]> Co-authored-by: Jonas S <[email protected]>
Issue
Like as #117, this problem occurs with ActiveRecord 6.1.4.4 and later, but doesn't occur with ActiveRecord 6.0.4.4 and below.
The following nested merge-joins query causes NoMethodError.
Reproduction
Test result
The text was updated successfully, but these errors were encountered: