Module: ElasticRecord::Model::ClassMethods

Defined in:
lib/elastic_record/model.rb

Instance Method Summary collapse

Instance Method Details

#arelasticObject



27
28
29
# File 'lib/elastic_record/model.rb', line 27

def arelastic
  Arelastic::Builders::Search
end

#elastic_indexObject



31
32
33
# File 'lib/elastic_record/model.rb', line 31

def elastic_index
  @elastic_index ||= ElasticRecord::Index.new(self)
end

#elastic_index=(index) ⇒ Object



35
36
37
# File 'lib/elastic_record/model.rb', line 35

def elastic_index=(index)
  @elastic_index = index
end

#elastic_relationObject



23
24
25
# File 'lib/elastic_record/model.rb', line 23

def elastic_relation
  ElasticRecord::Relation.new(self)
end

#inherited(child) ⇒ Object



15
16
17
18
19
20
21
# File 'lib/elastic_record/model.rb', line 15

def inherited(child)
  super

  if child < child.base_class
    child.elastic_index = elastic_index.dup
  end
end