We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
ransack_rails6.1.0.rc1.rb
require 'bundler/inline' gemfile(true) do source 'https://rubygems.org' gem 'activerecord', '~> 6.1.0.rc1', require: "active_record" gem 'sqlite3', '~> 1.4' gem 'ransack', '~> 2.3', '>= 2.3.2' gem 'minitest', '~> 5.14', '>= 5.14.2', require: "minitest/autorun" end ActiveRecord::Base.establish_connection( adapter: "sqlite3", database: "./test_ransack_bug" ) ActiveRecord::Schema.define do drop_table(:users, if_exists: true) drop_table(:topics, if_exists: true) create_table :users do |t| t.string :name end create_table :topics do |t| t.string :title t.belongs_to :users, null: false, foreign_key: true end end class User < ActiveRecord::Base has_many :topics end class Topic < ActiveRecord::Base belongs_to :user end class MyTest < Minitest::Test def test_should_be_true assert_equal Topic.joins(:user).to_sql, "SELECT \"topics\".* FROM \"topics\" INNER JOIN \"users\" ON \"users\".\"id\" = \"topics\".\"user_id\"" end end
deploy@ip-172-26-2-105:~$ ruby ransack_rails6.1.0.rc1.rb Fetching gem metadata from https://rubygems.org/........ Resolving dependencies... Using concurrent-ruby 1.1.7 Using i18n 1.8.5 Using minitest 5.14.2 Using tzinfo 2.0.3 Using zeitwerk 2.4.1 Using activesupport 6.1.0.rc1 Using activemodel 6.1.0.rc1 Using activerecord 6.1.0.rc1 Using bundler 2.1.4 Using polyamorous 2.3.2 Using ransack 2.3.2 Using sqlite3 1.4.2 -- drop_table(:users, {:if_exists=>true}) -> 0.1068s -- drop_table(:topics, {:if_exists=>true}) -> 0.0053s -- create_table(:users) -> 0.0049s -- create_table(:topics) -> 0.0086s Run options: --seed 13064 # Running: E Finished in 0.004383s, 228.1556 runs/s, 0.0000 assertions/s. 1) Error: MyTest#test_should_be_true: ArgumentError: wrong number of arguments (given 3, expected 2) /home/deploy/.rvm/gems/ruby-2.6.5/gems/polyamorous-2.3.2/lib/polyamorous/activerecord_6.0_ruby_2/join_dependency.rb:32:in `join_constraints' /home/deploy/.rvm/gems/ruby-2.6.5/gems/activerecord-6.1.0.rc1/lib/active_record/relation/query_methods.rb:1272:in `build_joins' /home/deploy/.rvm/gems/ruby-2.6.5/gems/activerecord-6.1.0.rc1/lib/active_record/relation/query_methods.rb:1136:in `build_arel' /home/deploy/.rvm/gems/ruby-2.6.5/gems/activerecord-6.1.0.rc1/lib/active_record/relation/query_methods.rb:1059:in `arel' /home/deploy/.rvm/gems/ruby-2.6.5/gems/activerecord-6.1.0.rc1/lib/active_record/relation.rb:672:in `block in to_sql' /home/deploy/.rvm/gems/ruby-2.6.5/gems/activerecord-6.1.0.rc1/lib/active_record/connection_adapters/abstract_adapter.rb:245:in `unprepared_statement' /home/deploy/.rvm/gems/ruby-2.6.5/gems/activerecord-6.1.0.rc1/lib/active_record/relation.rb:672:in `to_sql' ransack_rails6.1.0.rc1.rb:40:in `test_should_be_true' 1 runs, 0 assertions, 0 failures, 1 errors, 0 skips
The text was updated successfully, but these errors were encountered:
Can you try #1163 against your apps and let me know how it works?
Sorry, something went wrong.
gem 'ransack', github: 'activerecord-hackery/ransack', branch: 'rails_6.1_support' fixed this issue, thanks @deivid-rodriguez
gem 'ransack', github: 'activerecord-hackery/ransack', branch: 'rails_6.1_support'
awesome! thank you @deivid-rodriguez !
Successfully merging a pull request may close this issue.
ransack_rails6.1.0.rc1.rb
The text was updated successfully, but these errors were encountered: