Commit 45be88e1d512d9249f16943af4282ebf4875907b

Authored by Andrew Kane
1 parent 70b0ffdf

Added load: {dumpable: true} option - closes #887

CHANGELOG.md
1 1 ## 2.2.1 [unreleased]
2 2  
3 3 - Added `avg`, `cardinality`, `max`, `min`, and `sum` aggregations
  4 +- Added `load: {dumpable: true}` option
4 5 - Accept string for `exclude` option
5 6  
6 7 ## 2.2.0
... ...
lib/searchkick/results.rb
... ... @@ -33,7 +33,7 @@ module Searchkick
33 33 # sort
34 34 hits.map do |hit|
35 35 result = results[hit["_type"]][hit["_id"].to_s]
36   - if result
  36 + if result && !(options[:load].is_a?(Hash) && options[:load][:dumpable])
37 37 unless result.respond_to?(:search_hit)
38 38 result.define_singleton_method(:search_hit) do
39 39 hit
... ...
test/marshal_test.rb 0 → 100644
... ... @@ -0,0 +1,8 @@
  1 +require_relative "test_helper"
  2 +
  3 +class MarshalTest < Minitest::Test
  4 + def test_marshal
  5 + store_names ["Product A"]
  6 + assert Marshal.dump(Product.search("*", load: {dumpable: true}).results)
  7 + end
  8 +end
... ...