Commit 3de51462d4872111df77f1d7d0b2a991e2b7dc25

Authored by Andrew Kane
1 parent ce45f050

Fixed where [skip ci]

lib/searchkick/relation.rb
... ... @@ -34,7 +34,7 @@ module Searchkick
34 34 opts = sanitize_opts(opts)
35 35  
36 36 if options[:where]
37   - options[:where] = [{_and: [options[:where], opts]}]
  37 + options[:where] = {_and: [options[:where], opts]}
38 38 else
39 39 options[:where] = opts
40 40 end
... ...
test/relation_test.rb
... ... @@ -12,6 +12,11 @@ class RelationTest < Minitest::Test
12 12 assert_equal ["Product A"], Product.search(relation: true).map(&:name)
13 13 end
14 14  
  15 + def test_where
  16 + store_names ["Product A", "Product B"]
  17 + assert_search_relation [], Product.search("*", relation: true).where(name: "Product A").where(name: "Product B")
  18 + end
  19 +
15 20 def test_parameters
16 21 skip unless defined?(ActiveRecord)
17 22 require "action_controller"
... ...