From 810e358fa8e942892ed5eeb135cf66837b292690 Mon Sep 17 00:00:00 2001 From: andrea longhi Date: Fri, 15 Dec 2023 14:20:37 +0100 Subject: [PATCH] Patch Ransack::Nodes::Condition#casted_array? Issue: https://github.com/activerecord-hackery/ransack/issues/1467 PR: https://github.com/activerecord-hackery/ransack/pull/1468 Hopefully the PR will be merged soon so we can remove this patch. --- core/lib/solidus_core.rb | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/core/lib/solidus_core.rb b/core/lib/solidus_core.rb index bab4b80d02d..91268429010 100644 --- a/core/lib/solidus_core.rb +++ b/core/lib/solidus_core.rb @@ -7,3 +7,14 @@ def table_name name end end + + +module RansackNodeConditionPatch + private + + def casted_array?(predicate) + predicate.is_a?(Arel::Nodes::Casted) && predicate.value.is_a?(Array) + end + + Ransack::Nodes::Condition.prepend(self) +end