We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a9eb55f commit 049a2dbCopy full SHA for 049a2db
lib/searchkick/relation.rb
@@ -575,11 +575,12 @@ def where!(value)
575
check_loaded
576
value = ensure_permitted(value)
577
if @options[:where]
578
+ if @options[:where][:_and].is_a?(Array)
579
+ merge_option(:where, {_and: @options[:where][:_and] + [value]})
580
# keep simple when possible for smart aggs
- if !@options[:where].keys.intersect?(value.keys)
581
+ elsif !@options[:where].keys.intersect?(value.keys)
582
merge_option(:where, value)
583
else
- # TODO flatten
584
@options[:where] = {_and: [@options[:where], value]}
585
end
586
0 commit comments