Open spaghetticode opened 9 months ago
Interestingly, CI is not running on the PR 🤷
Interestingly, CI is not running on the PR 🤷
Needs to be approved for the 1st run.
@spaghetticode could you please add a test for this change?
@scarroll32 I've just added a test that fails without the change.
The method I modified is private, so it needs to be tested indirectly. I followed the existing examples, but I had to add a new ransacker to the Person
model, I hope it makes sense. Please let me know if it works for you, thanks!
I am also having this issue, will there be any movement on this PR @scarroll32 ?
NoMethodError:
undefined method `value' for #<Arel::SelectManager:0x000000010b0fb3b8 @ast=#<Arel::Nodes::SelectStatement:0x000000010b0fb390 @cores.........
predicate.value.is_a?(Array) && predicate.is_a?(Arel::Nodes::Casted)
^^^^^^
# ./spec/models/spree/product_spec.rb:667:in `block (3 levels) in <top (required)>'
Finished in 28 minutes 11 seconds (files took 4.77 seconds to load)
1 example, 1 failure
For now I have locked my gemfile to ransack 4.1.1
and specs pass on that version.
Closes https://github.com/activerecord-hackery/ransack/issues/1467
The previous implementation was giving for granted that every predicate respond to
#value
, which doesn't seem to be the case at least when having aArel::SelectManager
.by simply inverting the terms of the existing AND check we can fix the issue without introducing unknown side effects.