Module: ElasticRecord::Model::ClassMethods
- Defined in:
- lib/elastic_record/model.rb
Instance Method Summary collapse
- #arelastic ⇒ Object
- #elastic_index ⇒ Object
- #elastic_index=(index) ⇒ Object
- #elastic_relation ⇒ Object
- #inherited(child) ⇒ Object
Instance Method Details
#arelastic ⇒ Object
27 28 29 |
# File 'lib/elastic_record/model.rb', line 27 def arelastic Arelastic::Builders::Search end |
#elastic_index ⇒ Object
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_relation ⇒ Object
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 |