-
-
Notifications
You must be signed in to change notification settings - Fork 804
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
Rails 7.2 - LoadError: cannot load such file -- polyamorous/activerecord_7.2_ruby_2/join_association (LoadError) #1518
Comments
It seems that this is a fairly important issue to fix... ransack can not be used out-of-the-box in any project from rails 7.1+ |
PRs welcome |
@scarroll32 Maybe it will help someone who is also debugging this issue. Rails 7.2.1 x = ArticleCategory.ransack(title_eq: 'Child category')
x.result It produces the next It returns all of the records (should not). Backtrace of the calls: ransack-4.2.1/lib/ransack/adapters/active_record/base.rb:15 def ransack(params = {}, options = {})
Search.new(self, params, options)
end ransack-4.2.1/lib/ransack/search.rb:43 def result(opts = {})
@context.evaluate(self, opts)
end ransack-4.2.1/lib/ransack/adapters/active_record/context.rb:27 def evaluate(search, opts = {})
viz = Visitor.new
relation = @object.where(viz.accept(search.base))
...
end ransack-4.2.1/lib/ransack/visitor.rb def visit(object)
send(DISPATCH[object.class], object)
end and this will call The strange behavior that I noticed is that Ransack::Nodes::Condition does not have attributes, it returns an empty array. I read test cases so probably it is not correct behavior, also I run tests locally and they are all green, so the current issue is not covered by them. |
@EverardB Which versions of Ransack and Rails do you use? |
Possible cause https://github.com/activerecord-hackery/ransack/blob/main/lib/polyamorous/polyamorous.rb#L19C1-L20C1 PRs welcome |
@scarroll32 Could you please provide steps to reproduce the issue? |
Upgrade to rails 7.2 and you will get the following message whilst constructing the database...
bin/rails aborted!
LoadError: cannot load such file -- polyamorous/activerecord_7.2_ruby_2/join_association (LoadError)
Did you mean? polyamorous/activerecord_7.0_ruby_2/join_association
polyamorous/activerecord_6.1_ruby_2/join_association
polyamorous/activerecord_6.0_ruby_2/join_association
The text was updated successfully, but these errors were encountered: