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

Branch rails_6_1 does not work with latest Rails 6.1.4 #10

Open
serch opened this issue Jul 5, 2021 · 6 comments
Open

Branch rails_6_1 does not work with latest Rails 6.1.4 #10

serch opened this issue Jul 5, 2021 · 6 comments

Comments

@serch
Copy link

serch commented Jul 5, 2021

It seems the release of Rails 6.1.4 broke the branch rails_6_1 of the gem.

One error is that build_arel changed its signature from

def build_arel(aliases)

to

def build_arel(aliases = nil)

I fixed this in my fork of the gem but I was still having issues in my test suite, it seems the tests were halting.
Hopefully I'll have time later this week to take a look at this, however I figured I would still open the issue to let you guys know.

@booleanbetrayal
Copy link

@serch - Have you pushed these changes in your fork by chance?

@kmurph73
Copy link
Owner

Thanks for the report... missed this initial email of course. Pretty busy today but will look into it asap.

@serch
Copy link
Author

serch commented Jul 15, 2021

@serch - Have you pushed these changes in your fork by chance?

@booleanbetrayal this is the only commit I made Monsido@e5cef65

@kmurph73
Copy link
Owner

Wasn't able to reproduce this issue (not using this gem currently). However I pushed a rails_6_1_4 branch, that adjusts build_arel's signature

Can someone try it out and report back? Thank you.

@serch
Copy link
Author

serch commented Jul 29, 2021

@kmurph73 thanks for the fix!

I tested it against the test suite at work where we only have 3 CTEs and those worked just fine
some other tests that use update_all were failing though, this is a sample stacktrace:

1) Error:
TestClassTest::#test_method!#test_0001_test description:
NoMethodError: private method `build_arel' called for #<ActiveRecord::AssociationRelation []>
Did you mean?  build_where_clause
  /Users/my-user/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/activerecord-6.1.4/lib/active_record/relation/delegation.rb:110:in `method_missing'
  /Users/my-user/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/activerecord-6.1.4/lib/active_record/associations/collection_proxy.rb:1109:in `build_arel'
  /Users/my-user/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/activerecord-6.1.4/lib/active_record/relation.rb:443:in `update_all'
  /Users/my-user/my-app/test/models/test_class.rb:24:in `block (2 levels) in <class:TestClassTest>'

so I commented out the private modifier, ran the entire suite again, and all tests are green now!

@xxx
Copy link

xxx commented Jul 30, 2021

@kmurph73 The rails_6_1_4 branch works for us. We didn't run into the visibility issue that @serch mentions above.

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

No branches or pull requests

4 participants