Commit f50f9bd56f62c30afbe44b9bda70443f4fc98507

Authored by Andrew
1 parent 00e3ec9e

Less allocations [skip ci]

Showing 1 changed file with 3 additions and 1 deletions   Show diff stats
lib/searchkick/model.rb
@@ -83,7 +83,9 @@ module Searchkick @@ -83,7 +83,9 @@ module Searchkick
83 end unless method_defined?(:similar) 83 end unless method_defined?(:similar)
84 84
85 def search_data 85 def search_data
86 - (respond_to?(:to_hash) ? to_hash : serializable_hash).except("id", "_id") 86 + data = respond_to?(:to_hash) ? to_hash : serializable_hash
  87 + data.delete("id")
  88 + data
87 end unless method_defined?(:search_data) 89 end unless method_defined?(:search_data)
88 90
89 def should_index? 91 def should_index?