Please don't take this as any negativity, its awesome to see you guys are prepped for Rails 6.0 master :)
That being said I just spent a bit of time I hope to save for others to say that Rails RC1 does not have the change in method signature to ::ActiveRecord::Associations::JoinDependency.initialize that is being used by Ransack when you're running Rails 6.
It might have been good for the commits to Ransack to prepare by using .rc2 instead of .rc1 but I'm not sure myself and it isn't the point of this issue.
The commit changing ::ActiveRecord::Associations::JoinDependency.initialize was committed a few days after Rails RC1 was cut(https://github.com/rails/rails/pull/36120) but Ransack is already attempting to use it if it detects your Rails version is >= Rails 6.0.0.rc1
It is up to the Ransack team as to whether they'd like to make changes given that Rails hopefully will cut a RC2 soon and this issue will become moot. I just wanted to let other developers figure this issue out more quickly as they're upgrading or using Rails 6.
Hi @ozzyaaron thanks for posting this issue, and also for the constructive feedback. Thank you especially to @vrodokanakis who has done a huge amount of work to support Rails 6.
Rails 6 support has become a bit of a headache, esp. as it is not yet released and is changing. We need to support it, but perhaps we should hang back? The commit to master has not yet been cut into a new gem release, so it would be possible to back it out, and then wait for Rails 6 to be officially released.
The other option would be to patch the code in master and try to keep up with changes in the Rails 6 release candidates.
What is the community's feeling on this?
@ozzyaaron has a good point that its not clear enough that the current master branch is only compatible with latest Rails 6-0-stable branch and not 6.0.0.rc1. And this may lead to confusion.
But I don't think it's better to back out. It's been almost two months since rc1 was released so rc2 must be around the corner. In the original release schedule, which was a bit optimistic, DHH announced a timeframe of 1 month between rc1 and rc2.
My suggestion (as temporary measure) is to display a visible warning in Readme to prevent anyone from trying to use it or debug it with Rails 6.0.0.rc1.
I'll make sure when rc2 is released to change the minimum dependencies so this issue won't be anymore.
Great, thanks @vrodokanakis. I've added a note and we can review this when Rails 6 is offically released. I'll cut a new version of the gem soon.
gem 'rails', github: 'rails/rails', branch: '6-0-stable'
gem 'ransack'
Hi all, just FYI, it looks like ransack no longer works with the stable branch and have a new issue.
2.6.3 :003 > School.ransack
Traceback (most recent call last):
1: from (irb):3
ArgumentError (wrong number of arguments (given 3, expected 4))
Edit: nvm, I should be using master branch instead
gem 'ransack', github: 'activerecord-hackery/ransack'
Hi @seanfcarroll!
Would it be possible to cut a release with Rails 6.0.0.rc2 support? That should make it easier for users trying out Rails pre-releases.
I don't think it worth cutting a release to support an RC. You can just point to the master branch.
I don't think it changes anything, but I think a prerelease would be enough.
Anyways, I understand, thanks for considering anyways :)
gem 'ransack', github: 'activerecord-hackery/ransack'
Solved the problem for me.
If you are trying to use ransack master with rails 6.0.0 final (released today :tada:) you might want to use this patch: https://github.com/activerecord-hackery/ransack/pull/1054
Hi all,
Ransack breaking with rails 6.0.0 (released today)
Ransack version: 2.1.1 (even on master branch aada89548490f98dd3f1a65574ce20551c72d73c)
New release ransack 2.3.0 supports rails 6.0.0 final.
Posting here to hopefully get some more visibility on https://github.com/activerecord-hackery/ransack/issues/1039.
Polymorphic searching with Ransack is fundamentally broken since Activerecord 5.2.0. The linked issue lays out an error undefined method polymorphic?, which no longer happens since 5-2 stable, but there is an additional issue with invalid join statements being generated when searching on polymorphic relations.
@deivid-rodriguez graciously opened a PR to attempt to fix the undefined method polymorphic? error, but the invalid join statements are still a problem (see https://github.com/activerecord-hackery/ransack/pull/1077#issuecomment-542893393). I would tread very, very lightly if you are using this library for searching on Polymorphic relations on any AR version > 5.2, including 6.
If there are any contributors / maintainers that could spend some time trying to fix this issue, it would really help a lot of people out. Otherwise, polymorphic support should be removed entirely for AR versions > 5.2.
Most helpful comment
Hi all, just FYI, it looks like ransack no longer works with the stable branch and have a new issue.
Edit: nvm, I should be using
masterbranch instead