Commit 45ffbf460036e9952c951db0dbb09e0ed547492a

Authored by Andrew Kane
1 parent 0c17f353

Added ability to change document_type on a class level - closes #204

Showing 1 changed file with 5 additions and 1 deletions   Show diff stats
lib/searchkick/index.rb
... ... @@ -58,7 +58,11 @@ module Searchkick
58 58 end
59 59  
60 60 def klass_document_type(klass)
61   - klass.model_name.to_s.underscore
  61 + if klass.respond_to?(:document_type)
  62 + klass.document_type
  63 + else
  64 + klass.model_name.to_s.underscore
  65 + end
62 66 end
63 67  
64 68 protected
... ...