Commit 97fa0caf5a05a032ebd38ad3e58d8ed23f82d3e3

Authored by Andrew
1 parent f05a205a

Use keyword args [skip ci]

Showing 1 changed file with 3 additions and 3 deletions   Show diff stats
lib/searchkick.rb
... ... @@ -80,8 +80,8 @@ module Searchkick
80 80 Gem::Version.new(server_version.sub("-", ".")) < Gem::Version.new(version.sub("-", "."))
81 81 end
82 82  
83   - def self.search(term = "*", **options, &block)
84   - klass = options[:model]
  83 + def self.search(term = "*", model: nil, **options, &block)
  84 + klass = model
85 85  
86 86 # make Searchkick.search(index_name: [Product]) and Product.search equivalent
87 87 if !klass
... ... @@ -91,7 +91,7 @@ module Searchkick
91 91 end
92 92 end
93 93  
94   - query = Searchkick::Query.new(klass, term, options.except(:model))
  94 + query = Searchkick::Query.new(klass, term, options)
95 95 block.call(query.body) if block
96 96 if options[:execute] == false
97 97 query
... ...