lib/elasticsearch/model/naming.rb in elasticsearch-model-5.1.0 vs lib/elasticsearch/model/naming.rb in elasticsearch-model-6.0.0.pre
- old
+ new
@@ -3,10 +3,12 @@
# Provides methods for getting and setting index name and document type for the model
#
module Naming
+ DEFAULT_DOC_TYPE = '_doc'.freeze
+
module ClassMethods
# Get or set the name of the index
#
# @example Set the index name for the `Article` model
@@ -88,10 +90,10 @@
def default_index_name
self.model_name.collection.gsub(/\//, '-')
end
def default_document_type
- self.model_name.element
+ DEFAULT_DOC_TYPE
end
end
module InstanceMethods