Module: ElasticMapper::Mapping

Defined in:
lib/elastic_mapper/mapping.rb

Overview

Used to describe the mapping for an ActiveModel object, so that it can be indexed for search:

On The Topic of Mappings:

www.elasticsearch.org/guide/en/elasticsearch/reference/current/mapping.html

Defined Under Namespace

Modules: ClassMethods

Class Method Summary collapse

Class Method Details

.included(base) ⇒ Object



9
10
11
12
13
14
15
16
17
# File 'lib/elastic_mapper/mapping.rb', line 9

def self.included(base)
  # Default the mapping name, to the table_name variable.
  # this will be set for ActiveRecord models.
  if base.respond_to?(:table_name)
    base.instance_variable_set(:@_mapping_name, base.table_name.to_sym)
  end

  base.extend(ClassMethods)
end