From 6ca9a8df47b4d05bb5f33533c3263258b1cbad2b Mon Sep 17 00:00:00 2001 From: Andrew Date: Wed, 28 Feb 2018 19:06:37 -0800 Subject: [PATCH] Removed Model.document_type and record.search_document_type hooks [skip ci] --- lib/searchkick/index.rb | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/lib/searchkick/index.rb b/lib/searchkick/index.rb index 82ecd42..d3dfd29 100644 --- a/lib/searchkick/index.rb +++ b/lib/searchkick/index.rb @@ -320,9 +320,7 @@ module Searchkick def klass_document_type(klass, ignore_type = false) @klass_document_type[[klass, ignore_type]] ||= begin - if klass.respond_to?(:document_type) - klass.document_type - elsif !ignore_type && klass.searchkick_klass.searchkick_options[:_type] + if !ignore_type && klass.searchkick_klass.searchkick_options[:_type] type = klass.searchkick_klass.searchkick_options[:_type] type = type.call if type.respond_to?(:call) type @@ -339,11 +337,7 @@ module Searchkick end def document_type(record, ignore_type = false) - if record.respond_to?(:search_document_type) - record.search_document_type - else - klass_document_type(record.class, ignore_type) - end + klass_document_type(record.class, ignore_type) end def search_id(record) -- libgit2 0.21.0