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

Polyamorous::JoinDependency: wrong number of arguments (given 4, expected 3) #1036

Closed
23tux opened this issue Jun 24, 2019 · 2 comments
Closed

Comments

@23tux
Copy link

23tux commented Jun 24, 2019

Gemfile

gem "rails", "~> 6.0.0.rc1"
gem "ransack", github: "activerecord-hackery/ransack"

When I call ransack on a model

Issue.ransack

I get this error:

wrong number of arguments (given 4, expected 3)

The stacktrace leads to this location:

alias_tracker = ::ActiveRecord::Associations::AliasTracker.create(self.klass.connection, relation.table.name, join_list)
join_dependency = if ::ActiveRecord::VERSION::STRING >= Constants::RAILS_6_0
  Polyamorous::JoinDependency.new(relation.klass, relation.table, association_joins, Arel::Nodes::OuterJoin)
else
  Polyamorous::JoinDependency.new(relation.klass, relation.table, association_joins)
end

activerecord (6.0.0.rc1) lib/active_record/associations/join_dependency.rb:67:in `initialize' 
ransack (e17f1c60a065) lib/ransack/adapters/active_record/context.rb:285:in `new' 
ransack (e17f1c60a065) lib/ransack/adapters/active_record/context.rb:285:in `build_joins' 
ransack (e17f1c60a065) lib/ransack/adapters/active_record/context.rb:239:in `join_dependency' 
ransack (e17f1c60a065) lib/ransack/adapters/active_record/ransack/context.rb:27:in `initialize' 
ransack (e17f1c60a065) lib/ransack/adapters/active_record/context.rb:10:in `initialize' 
ransack (e17f1c60a065) lib/ransack/adapters/active_record/ransack/context.rb:11:in `new' 
ransack (e17f1c60a065) lib/ransack/adapters/active_record/ransack/context.rb:11:in `for_class' 
@vrodokanakis
Copy link
Contributor

See notice in README https://github.com/activerecord-hackery/ransack#rails-6-support and this issue #1032.

Until rc2 is released If you load Rails 6 from 6-0-stable branch it will work.

@scarroll32
Copy link
Member

Closed as per message 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

3 participants