Commit 6ca9a8df47b4d05bb5f33533c3263258b1cbad2b

Authored by Andrew
1 parent 4f6c182d

Removed Model.document_type and record.search_document_type hooks [skip ci]

Showing 1 changed file with 2 additions and 8 deletions   Show diff stats
lib/searchkick/index.rb
... ... @@ -320,9 +320,7 @@ module Searchkick
320 320  
321 321 def klass_document_type(klass, ignore_type = false)
322 322 @klass_document_type[[klass, ignore_type]] ||= begin
323   - if klass.respond_to?(:document_type)
324   - klass.document_type
325   - elsif !ignore_type && klass.searchkick_klass.searchkick_options[:_type]
  323 + if !ignore_type && klass.searchkick_klass.searchkick_options[:_type]
326 324 type = klass.searchkick_klass.searchkick_options[:_type]
327 325 type = type.call if type.respond_to?(:call)
328 326 type
... ... @@ -339,11 +337,7 @@ module Searchkick
339 337 end
340 338  
341 339 def document_type(record, ignore_type = false)
342   - if record.respond_to?(:search_document_type)
343   - record.search_document_type
344   - else
345   - klass_document_type(record.class, ignore_type)
346   - end
  340 + klass_document_type(record.class, ignore_type)
347 341 end
348 342  
349 343 def search_id(record)
... ...